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

Side by Side Diff: media/tools/layout_tests/layouttests_unittest.py

Issue 7693018: Intial checkin of layout test analyzer. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Modified based on CR comments. Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/tools/layout_tests/layouttests.py ('k') | media/tools/layout_tests/result/2011-08-19-11 » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/python
2 # Copyright (c) 2011 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.
5
6 import os
7 import unittest
8
9 from layouttests import LayoutTests
10 from test_expectations import TestExpectations
11
12
13 class TestLayoutTests(unittest.TestCase):
14 """Unit tests for the LayoutTests class."""
15
16 def testJoinWithTestExpectation(self):
17 layouttests = LayoutTests(csv_file_path=os.path.join('testname',
18 'media.csv'))
19 test_expectations = TestExpectations()
20 test_info_map = layouttests.JoinWithTestExpectation(test_expectations)
21 # TODO(imasaki): have better assertion below. Currently, the test
22 # expectation file is obtained dynamically so the strict assertion is
23 # impossible.
24 self.assertTrue(any(['media/' in k for k in test_info_map.keys()]),
25 msg=('Analyzer result should contain at least one '
26 'media test cases since we only retrieved media '
27 'related test'))
28
29 def testGetTestDescriptionsFromSVN(self):
30 desc1 = LayoutTests.GetTestDescriptionFromSVN(
31 'media/video-play-empty-events.html')
32 self.assertEquals(desc1,
33 ('Test that play() from EMPTY network state triggers '
34 'load() and async play event.'),
35 msg='Extracted test description is wrong')
36 desc2 = LayoutTests.GetTestDescriptionFromSVN('jquery/data.html')
37 self.assertEquals(desc2, 'UNKNOWN',
38 msg='Extracted test description is wrong')
39
40 def testGetParentDirectoryList(self):
41 testname_list = ['hoge1/hoge2/hoge3.html', 'hoge1/x.html',
42 'hoge1/hoge2/hoge4.html']
43 expected_result = ['hoge1/', 'hoge1/hoge2/']
44 self.assertEquals(LayoutTests.GetParentDirectoryList(testname_list),
45 expected_result)
46
47
48 if __name__ == '__main__':
49 unittest.main()
OLDNEW
« no previous file with comments | « media/tools/layout_tests/layouttests.py ('k') | media/tools/layout_tests/result/2011-08-19-11 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698