Roll src/third_party/WebKit 787a07c:716df21 (svn 201034:201036)
[chromium-blink-merge.git] / media / tools / layout_tests / test_expectations_unittest.py
blobb5ed2bfc540e9bbdb45b2c455f1ae40a11e2673f
1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
6 import unittest
8 from test_expectations import TestExpectations
11 class TestTestExpectations(unittest.TestCase):
13 def testParseLine(self):
14 line = ('crbug.com/86714 [ Mac Gpu ] media/video-zoom.html [ Crash '
15 'ImageOnlyFailure ]')
16 expected_map = {'CRASH': True, 'IMAGE': True, 'Bugs': ['BUGCR86714'],
17 'Comments': '', 'MAC': True, 'Gpu': True,
18 'Platforms': ['MAC', 'Gpu']}
19 self.assertEquals(TestExpectations.ParseLine(line),
20 ('media/video-zoom.html', expected_map))
22 def testParseLineWithLineComments(self):
23 line = ('crbug.com/86714 [ Mac Gpu ] media/video-zoom.html [ Crash '
24 'ImageOnlyFailure ] # foo')
25 expected_map = {'CRASH': True, 'IMAGE': True, 'Bugs': ['BUGCR86714'],
26 'Comments': ' foo', 'MAC': True, 'Gpu': True,
27 'Platforms': ['MAC', 'Gpu']}
28 self.assertEquals(TestExpectations.ParseLine(line),
29 ('media/video-zoom.html', expected_map))
31 def testParseLineWithLineGPUComments(self):
32 line = ('crbug.com/86714 [ Mac ] media/video-zoom.html [ Crash '
33 'ImageOnlyFailure ] # Gpu')
34 expected_map = {'CRASH': True, 'IMAGE': True, 'Bugs': ['BUGCR86714'],
35 'Comments': ' Gpu', 'MAC': True,
36 'Platforms': ['MAC']}
37 self.assertEquals(TestExpectations.ParseLine(line),
38 ('media/video-zoom.html', expected_map))
41 if __name__ == '__main__':
42 unittest.main()