Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: media/tools/layout_tests/test_expectations_unittest.py

Issue 10986008: Switch to using WebKit's test expecation parser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/tools/layout_tests/test_expectations_unittest.py
diff --git a/media/tools/layout_tests/test_expectations_unittest.py b/media/tools/layout_tests/test_expectations_unittest.py
index c5985fcc8499a2f918fe76fa4d23926a932a2807..b5ed2bfc540e9bbdb45b2c455f1ae40a11e2673f 100755
--- a/media/tools/layout_tests/test_expectations_unittest.py
+++ b/media/tools/layout_tests/test_expectations_unittest.py
@@ -11,51 +11,31 @@ from test_expectations import TestExpectations
class TestTestExpectations(unittest.TestCase):
def testParseLine(self):
- line = 'BUGCR86714 MAC GPU : media/video-zoom.html = CRASH IMAGE'
- comments = 'Comments'
+ line = ('crbug.com/86714 [ Mac Gpu ] media/video-zoom.html [ Crash '
+ 'ImageOnlyFailure ]')
expected_map = {'CRASH': True, 'IMAGE': True, 'Bugs': ['BUGCR86714'],
- 'Comments': 'Comments', 'MAC': True, 'GPU': True,
- 'Platforms': ['MAC', 'GPU']}
- self.assertEquals(TestExpectations.ParseLine(line, comments),
- expected_map)
+ 'Comments': '', 'MAC': True, 'Gpu': True,
+ 'Platforms': ['MAC', 'Gpu']}
+ self.assertEquals(TestExpectations.ParseLine(line),
+ ('media/video-zoom.html', expected_map))
def testParseLineWithLineComments(self):
- line = 'BUGCR86714 MAC GPU : media/video-zoom.html = CRASH IMAGE // foo'
- comments = 'Comments'
+ line = ('crbug.com/86714 [ Mac Gpu ] media/video-zoom.html [ Crash '
+ 'ImageOnlyFailure ] # foo')
expected_map = {'CRASH': True, 'IMAGE': True, 'Bugs': ['BUGCR86714'],
- 'Comments': 'Comments foo', 'MAC': True, 'GPU': True,
- 'Platforms': ['MAC', 'GPU']}
- self.assertEquals(TestExpectations.ParseLine(line, comments),
- expected_map)
+ 'Comments': ' foo', 'MAC': True, 'Gpu': True,
+ 'Platforms': ['MAC', 'Gpu']}
+ self.assertEquals(TestExpectations.ParseLine(line),
+ ('media/video-zoom.html', expected_map))
def testParseLineWithLineGPUComments(self):
- line = 'BUGCR86714 MAC : media/video-zoom.html = CRASH IMAGE // GPU'
- comments = 'Comments'
+ line = ('crbug.com/86714 [ Mac ] media/video-zoom.html [ Crash '
+ 'ImageOnlyFailure ] # Gpu')
expected_map = {'CRASH': True, 'IMAGE': True, 'Bugs': ['BUGCR86714'],
- 'Comments': 'Comments GPU', 'MAC': True,
+ 'Comments': ' Gpu', 'MAC': True,
'Platforms': ['MAC']}
- self.assertEquals(TestExpectations.ParseLine(line, comments),
- expected_map)
-
- def testExtractTestOrDirectoryName(self):
- line = ('BUGWK58013 MAC GPU : compositing/scaling/'
- 'tiled-layer-recursion.html = CRASH')
- self.assertEquals(TestExpectations.ExtractTestOrDirectoryName(line),
- 'compositing/scaling/tiled-layer-recursion.html')
-
- def testExtractTestOrDirectoryNameWithSvg(self):
- line = 'BUGWK43668 SKIP : media/track/x.svg = TIMEOUT'
- self.assertEquals(TestExpectations.ExtractTestOrDirectoryName(line),
- 'media/track/x.svg')
-
- def testExtractTestOrDirectoryNameWithDirName(self):
- line = 'BUGWK43668 SKIP : media/track/ = TIMEOUT'
- self.assertEquals(TestExpectations.ExtractTestOrDirectoryName(line),
- 'media/track/')
-
- def testExtractTestOrDirectoryNameWithException(self):
- self.assertRaises(ValueError,
- TestExpectations.ExtractTestOrDirectoryName, 'Foo')
+ self.assertEquals(TestExpectations.ParseLine(line),
+ ('media/video-zoom.html', expected_map))
if __name__ == '__main__':

Powered by Google App Engine
This is Rietveld 408576698