Skip to content

Commit 0f2d7bd

Browse files
committed
Bug 1522790 - [wptrunner] Use marionette new window command to open wptrunner windows r=jgraham,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D23972
1 parent b99eba5 commit 0f2d7bd

File tree

14 files changed

+66
-94
lines changed

14 files changed

+66
-94
lines changed

testing/web-platform/meta/css/css-conditional/container-queries/font-relative-units-dynamic.html.ini

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
expected: FAIL
44

55
[cap units respond to changes]
6-
expected:
7-
if not fission: FAIL
6+
expected: FAIL
87

98
[rch units respond to changes]
109
expected: FAIL
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[font-relative-units-dynamic.html]
2+
[rex units respond to changes]
3+
expected: FAIL
4+
5+
[rch units respond to changes]
6+
expected: FAIL
7+
8+
[ric units respond to changes]
9+
expected: FAIL
10+
11+
[cap units respond to changes]
12+
expected:
13+
if not fission and (os == "linux") and not debug and asan: [PASS, FAIL]
14+
if not fission and (os == "android"): FAIL
15+
if fission: FAIL
16+
FAIL
17+
18+
[rcap units respond to changes]
19+
expected: FAIL
20+
21+
[rlh units respond to changes]
22+
expected:
23+
if (os == "mac") and not debug: [PASS, FAIL]
24+
25+
[lh units respond to changes]
26+
expected:
27+
if (os == "mac") and not debug: [PASS, FAIL]

testing/web-platform/meta/html/canvas/element/text/2d.text.draw.fontface.notinpage.html.ini

-6
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
[resource-selection-candidate-insert-before.html]
22
[inserting another source before the candidate]
33
expected:
4+
if (os == "linux") and tsan: [PASS, FAIL]
45
if (os == "linux") and not tsan and not swgl and debug and fission: [FAIL, PASS]
56
if (os == "linux") and not tsan and not swgl and debug and not fission: [FAIL, PASS]
67
if (os == "linux") and not tsan and swgl and not fission: [FAIL, PASS]
8+
if (os == "linux") and not tsan and fission: [FAIL, PASS]
79
if (os == "linux") and not tsan and not swgl and not debug: [FAIL, PASS]
810
if (os == "win") and swgl: [FAIL, PASS]
9-
if (os == "linux") and tsan: [PASS, FAIL]
1011
FAIL
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
[resource-selection-invoke-insert-source-networkState.html]
22
[NOT invoking resource selection by inserting <source> when networkState is not NETWORK_EMPTY]
33
expected:
4-
if (os == "linux") and debug and fission and not swgl: [FAIL, PASS]
5-
if (os == "linux") and debug and not fission and not swgl: [FAIL, PASS]
6-
if (os == "linux") and debug and not fission and swgl: [FAIL, PASS]
4+
if (os == "linux"): [FAIL, PASS]
75
if (os == "win") and (processor == "x86") and debug: [FAIL, PASS]
8-
if (os == "linux") and not debug: [FAIL, PASS]
96
FAIL
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
[resource-selection-remove-source.html]
22
[Changes to networkState when inserting and removing a <source>]
33
expected:
4-
if (os == "win") and debug and (processor == "x86_64") and not swgl: [FAIL, PASS]
5-
if (os == "linux") and swgl and not fission: [FAIL, PASS]
64
if (os == "android") and debug and not swgl: [FAIL, PASS]
7-
if (os == "linux") and not swgl: [FAIL, PASS]
5+
if (os == "linux"): [FAIL, PASS]
6+
if (os == "win") and debug and (processor == "x86_64") and not swgl: [FAIL, PASS]
87
FAIL
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[resource-selection-remove-src.html]
22
[invoking resource selection by setting src; await stable state]
33
expected:
4+
if (os == "linux"): [FAIL, PASS]
45
if (os == "win") and debug and (processor == "x86_64") and not swgl: [FAIL, PASS]
5-
if (os == "linux") and swgl and not fission: [FAIL, PASS]
6-
if (os == "linux") and not swgl: [FAIL, PASS]
76
FAIL
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[newline-normalization.html]
22
expected:
33
if (os == "android") and fission: [TIMEOUT, OK]
4+
if (os == "android") and not fission: [TIMEOUT, OK]
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
[loaf-idle.html]
2-
expected: ERROR
2+
expected:
3+
if (os == "android") and fission: [ERROR, TIMEOUT]
4+
ERROR
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[input.html]
22
[The initiator type for <input type=image> must be 'input']
33
expected:
4-
if os == "mac": FAIL
4+
if os == "mac": PASS
55
if os == "android": PASS
66
[FAIL, PASS]

testing/web-platform/meta/resource-timing/no-entries-for-cross-origin-css-fetched.sub.html.ini

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
if (os == "linux") and not fission and not debug: [PASS, FAIL]
55
if (os == "linux") and not fission and debug: [PASS, FAIL]
66
if os == "android": FAIL
7+
FAIL

testing/web-platform/mozilla/meta/webdriver/harness/crash_content_process.py.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
CRASH
88

99
[test_detect_crash]
10-
bug: 1848850
10+
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1848850
1111
expected:
1212
[PASS, FAIL]

testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executormarionette.py

+17-61
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ def set_timeout(self, timeout):
104104
self.marionette.timeout.script = timeout
105105
self.timeout = timeout
106106

107+
def create_window(self, type="tab", **kwargs):
108+
return self.marionette.open(type=type, focus=True)["handle"]
109+
107110
@property
108111
def current_window(self):
109112
return self.marionette.current_window_handle
@@ -234,57 +237,6 @@ def dismiss_alert(self, f):
234237
else:
235238
break
236239

237-
def get_test_window(self, window_id, parent, timeout=5):
238-
"""Find the test window amongst all the open windows.
239-
This is assumed to be either the named window or the one after the parent in the list of
240-
window handles
241-
242-
:param window_id: The DOM name of the Window
243-
:param parent: The handle of the runner window
244-
:param timeout: The time in seconds to wait for the window to appear. This is because in
245-
some implementations there's a race between calling window.open and the
246-
window being added to the list of WebDriver accessible windows."""
247-
test_window = None
248-
end_time = time.time() + timeout
249-
while time.time() < end_time:
250-
if window_id:
251-
try:
252-
# Try this, it's in Level 1 but nothing supports it yet
253-
win_s = self.parent.base.execute_script("return window['%s'];" % self.window_id)
254-
win_obj = json.loads(win_s)
255-
test_window = win_obj["window-fcc6-11e5-b4f8-330a88ab9d7f"]
256-
except Exception:
257-
pass
258-
259-
if test_window is None:
260-
handles = self.marionette.window_handles
261-
if len(handles) == 2:
262-
test_window = next(iter(set(handles) - {parent}))
263-
elif len(handles) > 2 and handles[0] == parent:
264-
# Hope the first one here is the test window
265-
test_window = handles[1]
266-
267-
if test_window is not None:
268-
assert test_window != parent
269-
return test_window
270-
271-
time.sleep(0.1)
272-
273-
raise Exception("unable to find test window")
274-
275-
def test_window_loaded(self):
276-
"""Wait until the page in the new window has been loaded.
277-
278-
Hereby ignore Javascript execptions that are thrown when
279-
the document has been unloaded due to a process change.
280-
"""
281-
while True:
282-
try:
283-
self.parent.base.execute_script(self.window_loaded_script, asynchronous=True)
284-
break
285-
except errors.JavascriptException:
286-
pass
287-
288240

289241
class MarionettePrefsProtocolPart(PrefsProtocolPart):
290242
def setup(self):
@@ -999,16 +951,13 @@ def do_test(self, test):
999951
return (test.make_result(extra=extra, *data), [])
1000952

1001953
def do_testharness(self, protocol, url, timeout):
1002-
parent_window = protocol.testharness.close_old_windows(self.last_environment["protocol"])
954+
protocol.testharness.close_old_windows(self.last_environment["protocol"])
1003955

1004956
if self.protocol.coverage.is_enabled:
1005957
self.protocol.coverage.reset()
1006958

1007-
protocol.base.execute_script("window.open('about:blank', '%s', 'noopener')" % self.window_id)
1008-
test_window = protocol.testharness.get_test_window(self.window_id, parent_window,
1009-
timeout=10 * self.timeout_multiplier)
959+
test_window = protocol.base.create_window()
1010960
self.protocol.base.set_window(test_window)
1011-
protocol.testharness.test_window_loaded()
1012961

1013962
if self.debug_test and self.browser.supports_devtools:
1014963
self.protocol.debug.load_devtools()
@@ -1072,8 +1021,6 @@ def __init__(self, logger, browser, server_config, timeout_multiplier=1,
10721021

10731022
self.install_extensions = browser.extensions
10741023

1075-
with open(os.path.join(here, "reftest.js")) as f:
1076-
self.script = f.read()
10771024
with open(os.path.join(here, "test-wait.js")) as f:
10781025
self.wait_script = f.read() % {"classname": "reftest-wait"}
10791026

@@ -1121,10 +1068,19 @@ def do_test(self, test):
11211068
self.has_window = False
11221069

11231070
if not self.has_window:
1124-
self.protocol.base.execute_script(self.script)
1125-
self.protocol.base.set_window(self.protocol.marionette.window_handles[-1])
1071+
self.protocol.base.create_window(type="window")
1072+
# Resize the browser window so that its inner dimensions have
1073+
# exactly a size of 800x600 pixels, which means ignoring all
1074+
# visible toolbars and sidebars.
1075+
offsets = self.protocol.marionette.execute_script("""
1076+
return {
1077+
width: window.outerWidth - window.innerWidth,
1078+
height: window.outerHeight - window.innerHeight,
1079+
};
1080+
""")
1081+
self.protocol.marionette.set_window_rect(
1082+
x=0, y=0, width=800 + offsets["width"], height=600 + offsets["height"])
11261083
self.has_window = True
1127-
self.protocol.testharness.test_window_loaded()
11281084

11291085
if self.protocol.coverage.is_enabled:
11301086
self.protocol.coverage.reset()

testing/web-platform/tests/tools/wptrunner/wptrunner/executors/protocol.py

+8-12
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,14 @@ def wait(self):
158158
:returns: True to re-run the test, or False to continue with the next test"""
159159
pass
160160

161+
@abstractmethod
162+
def create_window(self, type="tab", **kwargs):
163+
"""Return a handle identifying a freshly created top level browsing context
164+
165+
:param type: - Type hint, either "tab" or "window"
166+
:returns: A protocol-specific handle"""
167+
pass
168+
161169
@property
162170
def current_window(self):
163171
"""Return a handle identifying the current top level browsing context
@@ -210,18 +218,6 @@ def close_old_windows(self, url_protocol):
210218
"""
211219
pass
212220

213-
@abstractmethod
214-
def get_test_window(self, window_id: str, parent: str) -> str:
215-
"""Get the window handle dorresponding to the window containing the
216-
currently active test.
217-
218-
:param window_id: A string containing the DOM name of the Window that
219-
contains the test, or None.
220-
:param parent: The handle of the runner window.
221-
:returns: A protocol-specific window handle.
222-
"""
223-
pass
224-
225221
@abstractmethod
226222
def test_window_loaded(self):
227223
"""Wait until the newly opened test window has been loaded."""

0 commit comments

Comments
 (0)