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

Unified 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, 4 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
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/tools/layout_tests/layouttests_unittest.py
diff --git a/media/tools/layout_tests/layouttests_unittest.py b/media/tools/layout_tests/layouttests_unittest.py
new file mode 100755
index 0000000000000000000000000000000000000000..ccd1ec856d809d2644f465408b0d0369f2b30447
--- /dev/null
+++ b/media/tools/layout_tests/layouttests_unittest.py
@@ -0,0 +1,49 @@
+#!/usr/bin/python
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import os
+import unittest
+
+from layouttests import LayoutTests
+from test_expectations import TestExpectations
+
+
+class TestLayoutTests(unittest.TestCase):
+ """Unit tests for the LayoutTests class."""
+
+ def testJoinWithTestExpectation(self):
+ layouttests = LayoutTests(csv_file_path=os.path.join('testname',
+ 'media.csv'))
+ test_expectations = TestExpectations()
+ test_info_map = layouttests.JoinWithTestExpectation(test_expectations)
+ # TODO(imasaki): have better assertion below. Currently, the test
+ # expectation file is obtained dynamically so the strict assertion is
+ # impossible.
+ self.assertTrue(any(['media/' in k for k in test_info_map.keys()]),
+ msg=('Analyzer result should contain at least one '
+ 'media test cases since we only retrieved media '
+ 'related test'))
+
+ def testGetTestDescriptionsFromSVN(self):
+ desc1 = LayoutTests.GetTestDescriptionFromSVN(
+ 'media/video-play-empty-events.html')
+ self.assertEquals(desc1,
+ ('Test that play() from EMPTY network state triggers '
+ 'load() and async play event.'),
+ msg='Extracted test description is wrong')
+ desc2 = LayoutTests.GetTestDescriptionFromSVN('jquery/data.html')
+ self.assertEquals(desc2, 'UNKNOWN',
+ msg='Extracted test description is wrong')
+
+ def testGetParentDirectoryList(self):
+ testname_list = ['hoge1/hoge2/hoge3.html', 'hoge1/x.html',
+ 'hoge1/hoge2/hoge4.html']
+ expected_result = ['hoge1/', 'hoge1/hoge2/']
+ self.assertEquals(LayoutTests.GetParentDirectoryList(testname_list),
+ expected_result)
+
+
+if __name__ == '__main__':
+ unittest.main()
« 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