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.
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 '
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,
37 self
.assertEquals(TestExpectations
.ParseLine(line
),
38 ('media/video-zoom.html', expected_map
))
41 if __name__
== '__main__':