Title: [159998] trunk/Tools
Revision
159998
Author
[email protected]
Date
2013-12-03 04:40:31 -0800 (Tue, 03 Dec 2013)

Log Message

Remove get_test() and reference test names directly instead.
https://bugs.webkit.org/show_bug.cgi?id=124962

Patch by Dániel Bátyai <[email protected]> on 2013-12-03
Reviewed by Csaba Osztrogonác.

* Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py:
(Base.__init__):
(Base.get_basic_tests):
(assert_exp):
(MiscTests.test_multiple_results):
(MiscTests.test_category_expectations):
(MiscTests.test_get_modifiers):
(MiscTests.test_get_expectations_string):
(MiscTests.test_get_test_set):
(MiscTests.test_parse_warning):
(MiscTests.test_pixel_tests_flag.match):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (159997 => 159998)


--- trunk/Tools/ChangeLog	2013-12-03 12:30:22 UTC (rev 159997)
+++ trunk/Tools/ChangeLog	2013-12-03 12:40:31 UTC (rev 159998)
@@ -1,3 +1,22 @@
+2013-12-03  Dániel Bátyai  <[email protected]>
+
+        Remove get_test() and reference test names directly instead.
+        https://bugs.webkit.org/show_bug.cgi?id=124962
+
+        Reviewed by Csaba Osztrogonác.
+
+        * Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py:
+        (Base.__init__):
+        (Base.get_basic_tests):
+        (assert_exp):
+        (MiscTests.test_multiple_results):
+        (MiscTests.test_category_expectations):
+        (MiscTests.test_get_modifiers):
+        (MiscTests.test_get_expectations_string):
+        (MiscTests.test_get_test_set):
+        (MiscTests.test_parse_warning):
+        (MiscTests.test_pixel_tests_flag.match):
+
 2013-12-03  Gergo Balogh  <[email protected]>
 
         Style Checker false pass.

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py (159997 => 159998)


--- trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py	2013-12-03 12:30:22 UTC (rev 159997)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py	2013-12-03 12:40:31 UTC (rev 159998)
@@ -53,17 +53,13 @@
         self._exp = None
         unittest.TestCase.__init__(self, testFunc)
 
-    def get_test(self, test_name):
-        # FIXME: Remove this routine and just reference test names directly.
-        return test_name
-
     def get_basic_tests(self):
-        return [self.get_test('failures/expected/text.html'),
-                self.get_test('failures/expected/image_checksum.html'),
-                self.get_test('failures/expected/crash.html'),
-                self.get_test('failures/expected/missing_text.html'),
-                self.get_test('failures/expected/image.html'),
-                self.get_test('passes/text.html')]
+        return ['failures/expected/text.html',
+                'failures/expected/image_checksum.html',
+                'failures/expected/crash.html',
+                'failures/expected/missing_text.html',
+                'failures/expected/image.html',
+                'passes/text.html']
 
     def get_basic_expectations(self):
         return """
@@ -84,7 +80,7 @@
         self._exp = TestExpectations(self._port, self.get_basic_tests(), expectations_to_lint=expectations_to_lint)
 
     def assert_exp(self, test, result):
-        self.assertEqual(self._exp.get_expectations(self.get_test(test)),
+        self.assertEqual(self._exp.get_expectations(test),
                           set([result]))
 
     def assert_bad_expectations(self, expectations, overrides=None):
@@ -104,7 +100,7 @@
     def test_multiple_results(self):
         self.parse_exp('Bug(x) failures/expected/text.html [ Crash Failure ]')
         self.assertEqual(self._exp.get_expectations(
-            self.get_test('failures/expected/text.html')),
+            'failures/expected/text.html'),
             set([FAIL, CRASH]))
 
     def test_result_was_expected(self):
@@ -140,21 +136,18 @@
         exp_str = 'Bug(x) failures/expected [ WontFix ]'
         self.parse_exp(exp_str)
         test_name = 'failures/expected/unknown-test.html'
-        unknown_test = self.get_test(test_name)
+        unknown_test = test_name
         self.assertRaises(KeyError, self._exp.get_expectations,
                           unknown_test)
         self.assert_exp('failures/expected/crash.html', PASS)
 
     def test_get_modifiers(self):
         self.parse_exp(self.get_basic_expectations())
-        self.assertEqual(self._exp.get_modifiers(
-                         self.get_test('passes/text.html')), [])
+        self.assertEqual(self._exp.get_modifiers('passes/text.html'), [])
 
     def test_get_expectations_string(self):
         self.parse_exp(self.get_basic_expectations())
-        self.assertEqual(self._exp.get_expectations_string(
-                          self.get_test('failures/expected/text.html')),
-                          'FAIL')
+        self.assertEqual(self._exp.get_expectations_string('failures/expected/text.html'), 'FAIL')
 
     def test_expectation_to_string(self):
         # Normal cases are handled by other tests.
@@ -167,14 +160,13 @@
         self.parse_exp(self.get_basic_expectations())
         s = self._exp.get_test_set(WONTFIX)
         self.assertEqual(s,
-            set([self.get_test('failures/expected/crash.html'),
-                 self.get_test('failures/expected/image_checksum.html')]))
+            set(['failures/expected/crash.html',
+                 'failures/expected/image_checksum.html']))
 
     def test_parse_warning(self):
         try:
             filesystem = self._port.host.filesystem
             filesystem.write_text_file(filesystem.join(self._port.layout_tests_dir(), 'disabled-test.html-disabled'), 'content')
-            self.get_test('disabled-test.html-disabled'),
             self.parse_exp("[ FOO ] failures/expected/text.html [ Failure ]\n"
                 "Bug(rniwa) non-existent-test.html [ Failure ]\n"
                 "Bug(rniwa) disabled-test.html-disabled [ ImageOnlyFailure ]", is_lint_mode=True)
@@ -224,7 +216,7 @@
     def test_pixel_tests_flag(self):
         def match(test, result, pixel_tests_enabled):
             return self._exp.matches_an_expected_result(
-                self.get_test(test), result, pixel_tests_enabled)
+                test, result, pixel_tests_enabled)
 
         self.parse_exp(self.get_basic_expectations())
         self.assertTrue(match('failures/expected/text.html', FAIL, True))
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to