Skip to content

Commit 6f11f80

Browse files
[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): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@219300 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent deeac68 commit 6f11f80

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

Tools/ChangeLog

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
2017-07-10 Zan Dobersek <[email protected]>
2+
3+
[WPE] Fix layout test baseline and TestExpectations hierarchy
4+
https://bugs.webkit.org/show_bug.cgi?id=174092
5+
6+
Reviewed by Michael Catanzaro.
7+
8+
Like for the GTK+ port, override the default_baseline_search_path() and
9+
_port_specific_expectations_files() methods in the webkitpy.port.WPEPort class.
10+
Both methods operate on a short list of search paths that defaults to 'wpe' and
11+
'wk2', along with any other user-specified platform directory.
12+
13+
The test_expectations_file_position() method is overridden for testing purposes,
14+
and relevant unit tests are added.
15+
16+
* Scripts/webkitpy/port/wpe.py:
17+
(WPEPort._search_paths):
18+
(WPEPort):
19+
(WPEPort.default_baseline_search_path):
20+
(WPEPort._port_specific_expectations_files):
21+
(WPEPort.test_expectations_file_position):
22+
* Scripts/webkitpy/port/wpe_unittest.py:
23+
(WPEPortTest.test_default_baseline_search_path):
24+
(WPEPortTest):
25+
(WPEPortTest.test_port_specific_expectations_files):
26+
127
2017-07-10 Chris Dumez <[email protected]>
228

329
Further WebResourceLoadStatisticsStore / ResourceLoadStatisticsStore clean up

Tools/Scripts/webkitpy/port/wpe.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,19 @@ def _path_to_driver(self):
8181
def _path_to_image_diff(self):
8282
return self._built_executables_path('ImageDiff')
8383

84+
def _search_paths(self):
85+
return [self.port_name, 'wk2'] + self.get_option("additional_platform_directory", [])
86+
87+
def default_baseline_search_path(self):
88+
return map(self._webkit_baseline_path, self._search_paths())
89+
90+
def _port_specific_expectations_files(self):
91+
return map(lambda x: self._filesystem.join(self._webkit_baseline_path(x), 'TestExpectations'), reversed(self._search_paths()))
92+
93+
def test_expectations_file_position(self):
94+
# WPE port baseline search path is wpe -> wk2 -> generic, so port test expectations file is at third to last position.
95+
return 2
96+
8497
def _get_crash_log(self, name, pid, stdout, stderr, newer_than, target_host=None):
8598
name = "WPEWebProcess" if name == "WebProcess" else name
8699
return GDBCrashLogGenerator(name, pid, newer_than, self._filesystem, self._path_to_driver).generate_crash_log(stdout, stderr)

Tools/Scripts/webkitpy/port/wpe_unittest.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ def make_port(self, host=None, port_name=None, options=None, os_name=None, os_ve
5151
port._pulseaudio_sanitizer = PulseAudioSanitizerMock()
5252
return port
5353

54+
def test_default_baseline_search_path(self):
55+
port = self.make_port()
56+
self.assertEqual(port.default_baseline_search_path(), ['/mock-checkout/LayoutTests/platform/wpe',
57+
'/mock-checkout/LayoutTests/platform/wk2'])
58+
59+
def test_port_specific_expectations_files(self):
60+
port = self.make_port()
61+
self.assertEqual(port.expectations_files(), ['/mock-checkout/LayoutTests/TestExpectations',
62+
'/mock-checkout/LayoutTests/platform/wk2/TestExpectations',
63+
'/mock-checkout/LayoutTests/platform/wpe/TestExpectations'])
64+
5465
def test_default_timeout_ms(self):
5566
self.assertEqual(self.make_port(options=MockOptions(configuration='Release')).default_timeout_ms(), 15000)
5667
self.assertEqual(self.make_port(options=MockOptions(configuration='Debug')).default_timeout_ms(), 30000)

0 commit comments

Comments
 (0)