Closed Bug 1547827 Opened 6 years ago Closed 6 years ago

Web platform test that modifies window.location triggers "JavaScriptError: Document was unloaded"

Categories

(Testing :: web-platform-tests, defect)

Version 3
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: botond, Unassigned)

References

Details

I'm trying to get the web platform tests for the Visual Viewport API enabled (bug 1477610).

One of these tests, viewport-resize-event-on-load-overflowing-page.html, triggers an error in the test harness when run:

Unexpected Results
------------------
ERROR /visual-viewport/viewport-resize-event-on-load-overflowing-page.html - JavaScriptError: Document was unloaded
Traceback (most recent call last):
  File "/home/botond/dev/mozilla/refactoring/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executormarionette.py", line 605, in _run
    self.result = True, self.func(self.protocol, self.url, self.timeout)
  File "/home/botond/dev/mozilla/refactoring/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executormarionette.py", line 719, in do_testharness
    self.script_resume % format_map, async=True)
  File "/home/botond/dev/mozilla/refactoring/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executormarionette.py", line 61, in execute_script
    return method(script, new_sandbox=False, sandbox=None)
  File "/home/botond/dev/mozilla/refactoring/testing/marionette/client/marionette_driver/marionette.py", line 1656, in execute_async_script
    rv = self._send_message("WebDriver:ExecuteAsyncScript", body, key="value")
  File "/home/botond/dev/mozilla/refactoring/testing/marionette/client/marionette_driver/decorators.py", line 26, in _
    return func(*args, **kwargs)
  File "/home/botond/dev/mozilla/refactoring/testing/marionette/client/marionette_driver/marionette.py", line 598, in _send_message
    self._handle_error(err)
  File "/home/botond/dev/mozilla/refactoring/testing/marionette/client/marionette_driver/marionette.py", line 618, in _handle_error
    raise errors.lookup(error)(message, stacktrace=stacktrace)
JavascriptException: JavaScriptError: Document was unloaded
stacktrace:
        WebDriverError@chrome://marionette/content/error.js:179:5
        JavaScriptError@chrome://marionette/content/error.js:356:5
        evaluate.sandbox/promise</unloadHandler<@chrome://marionette/content/evaluate.js:124:22
        EventHandlerNonNull*evaluate.sandbox/promise<@chrome://marionette/content/evaluate.js:125:5
        evaluate.sandbox@chrome://marionette/content/evaluate.js:106:17
        execute@chrome://marionette/content/listener.js:664:19
        dispatch/</req<@chrome://marionette/content/listener.js:480:17
        dispatch/<@chrome://marionette/content/listener.js:475:15
        MessageListener.receiveMessage*startListeners@chrome://marionette/content/listener.js:526:3
        registerSelf@chrome://marionette/content/listener.js:456:5
        @chrome://marionette/content/listener.js:1682:1

I assume this is related to the test modifying window.location.href.

Is this a known limitation of our WPT harness?

Blocks: 1477610

Yeah, that won't work (and the same harness is used on wpt.fyi so it won't work there either). The harness needs access to script that's injected into the initial window to function. You need to window.open a new window if you want to mess with the location.

See Also: → 1550813

The priority flag is not set for this bug.
:jgraham, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(james)

Going to call this invalid since it's working as expected and there's another bug to fix the test.

Status: NEW → RESOLVED
Closed: 6 years ago
Flags: needinfo?(james)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.