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

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: Minor modifications. 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
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..655fe3baca7f1660b6ed17376a22d0d98c349283
--- /dev/null
+++ b/media/tools/layout_tests/layouttests_unittest.py
@@ -0,0 +1,40 @@
+#!/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):
+ """A class for unittest for layouttests class."""
dennis_jeffrey 2011/08/25 00:36:46 'Unit tests for the LayoutTests class.'
imasaki1 2011/08/25 23:57:03 Done.
+
+ def testJoinWithTestExpectation(self):
+ layouttests = LayoutTests(csv_file_path=os.path.join('testname',
+ 'media.csv'))
+ test_expectations = TestExpectations()
+ test_info_map = layouttests.JoinWithTestExpectation(test_expectations)
dennis_jeffrey 2011/08/25 00:36:46 any verification that should be done in this test?
imasaki1 2011/08/25 23:57:03 Done.
+
+ def testGetTestDescriptionsFromSVN(self):
+ desc1 = LayoutTests.GetTestDescriptionFromSVN(
+ 'media/track/track-webvtt-tc004-magicheader.html')
+ self.assertEquals(desc1,
+ ('Tests that the magic file header "WEBVTT" leads to the'
+ ' file properly recognized as a WebVTT file.'),
+ 'Test description is wrong')
dennis_jeffrey 2011/08/25 00:36:46 nit: indent the above 3 lines by 1 more space each
imasaki1 2011/08/25 23:57:03 Done.
+ desc2 = LayoutTests.GetTestDescriptionFromSVN('jquery/data.html')
+ self.assertEquals(desc2, 'UNKNOWN', 'Test description is wrong')
dennis_jeffrey 2011/08/25 00:36:46 msg='Test description is wrong'
imasaki1 2011/08/25 23:57:03 Done.
+
+ def testGetParentDirectoryList(self):
+ l = ['hoge1/hoge2/hoge3.html', 'hoge1/x.html', 'hoge1/hoge2/hoge4.html']
dennis_jeffrey 2011/08/25 00:36:46 recommend a more descriptive variable name than 'l
imasaki1 2011/08/25 23:57:03 Done.
+ expected_result = ['hoge1/', 'hoge1/hoge2/']
+ assertEquals(LayoutTests.GetParentDirectoryList(l),
+ expected_result)
+
+
+if __name__ == '__main__':
+ unittest.main()

Powered by Google App Engine
This is Rietveld 408576698