Title: [219300] trunk/Tools
Revision
219300
Author
zandober...@gmail.com
Date
2017-07-10 11:07:10 -0700 (Mon, 10 Jul 2017)

Log Message

[WPE] Fix layout test baseline and TestExpectations hierarchy
https://bugs.webkit.org/show_bug.cgi?id=174092

Reviewed by Michael Catanzaro.

Like for the GTK+ port, override the default_baseline_search_path() and
_port_specific_expectations_files() methods in the webkitpy.port.WPEPort class.
Both methods operate on a short list of search paths that defaults to 'wpe' and
'wk2', along with any other user-specified platform directory.

The test_expectations_file_position() method is overridden for testing purposes,
and relevant unit tests are added.

* Scripts/webkitpy/port/wpe.py:
(WPEPort._search_paths):
(WPEPort):
(WPEPort.default_baseline_search_path):
(WPEPort._port_specific_expectations_files):
(WPEPort.test_expectations_file_position):
* Scripts/webkitpy/port/wpe_unittest.py:
(WPEPortTest.test_default_baseline_search_path):
(WPEPortTest):
(WPEPortTest.test_port_specific_expectations_files):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (219299 => 219300)


--- trunk/Tools/ChangeLog	2017-07-10 17:52:06 UTC (rev 219299)
+++ trunk/Tools/ChangeLog	2017-07-10 18:07:10 UTC (rev 219300)
@@ -1,3 +1,29 @@
+2017-07-10  Zan Dobersek  <zdober...@igalia.com>
+
+        [WPE] Fix layout test baseline and TestExpectations hierarchy
+        https://bugs.webkit.org/show_bug.cgi?id=174092
+
+        Reviewed by Michael Catanzaro.
+
+        Like for the GTK+ port, override the default_baseline_search_path() and
+        _port_specific_expectations_files() methods in the webkitpy.port.WPEPort class.
+        Both methods operate on a short list of search paths that defaults to 'wpe' and
+        'wk2', along with any other user-specified platform directory.
+
+        The test_expectations_file_position() method is overridden for testing purposes,
+        and relevant unit tests are added.
+
+        * Scripts/webkitpy/port/wpe.py:
+        (WPEPort._search_paths):
+        (WPEPort):
+        (WPEPort.default_baseline_search_path):
+        (WPEPort._port_specific_expectations_files):
+        (WPEPort.test_expectations_file_position):
+        * Scripts/webkitpy/port/wpe_unittest.py:
+        (WPEPortTest.test_default_baseline_search_path):
+        (WPEPortTest):
+        (WPEPortTest.test_port_specific_expectations_files):
+
 2017-07-10  Chris Dumez  <cdu...@apple.com>
 
         Further WebResourceLoadStatisticsStore / ResourceLoadStatisticsStore clean up

Modified: trunk/Tools/Scripts/webkitpy/port/wpe.py (219299 => 219300)


--- trunk/Tools/Scripts/webkitpy/port/wpe.py	2017-07-10 17:52:06 UTC (rev 219299)
+++ trunk/Tools/Scripts/webkitpy/port/wpe.py	2017-07-10 18:07:10 UTC (rev 219300)
@@ -81,6 +81,19 @@
     def _path_to_image_diff(self):
         return self._built_executables_path('ImageDiff')
 
+    def _search_paths(self):
+        return [self.port_name, 'wk2'] + self.get_option("additional_platform_directory", [])
+
+    def default_baseline_search_path(self):
+        return map(self._webkit_baseline_path, self._search_paths())
+
+    def _port_specific_expectations_files(self):
+        return map(lambda x: self._filesystem.join(self._webkit_baseline_path(x), 'TestExpectations'), reversed(self._search_paths()))
+
+    def test_expectations_file_position(self):
+        # WPE port baseline search path is wpe -> wk2 -> generic, so port test expectations file is at third to last position.
+        return 2
+
     def _get_crash_log(self, name, pid, stdout, stderr, newer_than, target_host=None):
         name = "WPEWebProcess" if name == "WebProcess" else name
         return GDBCrashLogGenerator(name, pid, newer_than, self._filesystem, self._path_to_driver).generate_crash_log(stdout, stderr)

Modified: trunk/Tools/Scripts/webkitpy/port/wpe_unittest.py (219299 => 219300)


--- trunk/Tools/Scripts/webkitpy/port/wpe_unittest.py	2017-07-10 17:52:06 UTC (rev 219299)
+++ trunk/Tools/Scripts/webkitpy/port/wpe_unittest.py	2017-07-10 18:07:10 UTC (rev 219300)
@@ -51,6 +51,17 @@
         port._pulseaudio_sanitizer = PulseAudioSanitizerMock()
         return port
 
+    def test_default_baseline_search_path(self):
+        port = self.make_port()
+        self.assertEqual(port.default_baseline_search_path(), ['/mock-checkout/LayoutTests/platform/wpe',
+            '/mock-checkout/LayoutTests/platform/wk2'])
+
+    def test_port_specific_expectations_files(self):
+        port = self.make_port()
+        self.assertEqual(port.expectations_files(), ['/mock-checkout/LayoutTests/TestExpectations',
+            '/mock-checkout/LayoutTests/platform/wk2/TestExpectations',
+            '/mock-checkout/LayoutTests/platform/wpe/TestExpectations'])
+
     def test_default_timeout_ms(self):
         self.assertEqual(self.make_port(options=MockOptions(configuration='Release')).default_timeout_ms(), 15000)
         self.assertEqual(self.make_port(options=MockOptions(configuration='Debug')).default_timeout_ms(), 30000)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to