Add automated testing for No Window Update Restarts
Categories
(Toolkit :: Application Update, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox106 | --- | fixed |
People
(Reporter: bytesized, Assigned: bytesized)
References
Details
(Whiteboard: [fidedi-ope])
Attachments
(2 files, 1 obsolete file)
This bug will track adding automated testing for No Window Update Restarts (Bug 1720742).
I am currently planning to land the No Window Update Restarts feature without automated testing. See Bug 1726460 for an explanation of why it is not feasible to add them now.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
Assignee | ||
Comment 2•2 years ago
|
||
This is a stripped down testcase illustrating the problem that I'm having getting this test working. The test works fine if I remove this:
self.marionette.delete_session()
self.marionette.start_session({"moz:windowless": True})
But with it, the test fails with
0:12.77 WARNING Failed to gather test failure debug: Browsing context has been discarded
stacktrace:
WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:188:5
NoSuchWindowError@chrome://remote/content/shared/webdriver/Errors.jsm:442:5
assert.that/<@chrome://remote/content/shared/webdriver/Assert.jsm:493:13
assert.open@chrome://remote/content/shared/webdriver/Assert.jsm:155:4
GeckoDriver.prototype.takeScreenshot@chrome://remote/content/marionette/driver.js:2331:15
despatch@chrome://remote/content/marionette/server.js:304:40
execute@chrome://remote/content/marionette/server.js:277:16
onPacket/<@chrome://remote/content/marionette/server.js:250:20
onPacket@chrome://remote/content/marionette/server.js:251:9
_onJSONObjectReady/<@chrome://remote/content/marionette/transport.js:502:20
0:12.77 TEST_END: ERROR, expected PASS - marionette_driver.errors.NoSuchWindowException: Browsing context has been discarded
stacktrace:
WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:188:5
NoSuchWindowError@chrome://remote/content/shared/webdriver/Errors.jsm:442:5
assert.that/<@chrome://remote/content/shared/webdriver/Assert.jsm:493:13
assert.open@chrome://remote/content/shared/webdriver/Assert.jsm:155:4
GeckoDriver.prototype.execute_@chrome://remote/content/marionette/driver.js:752:15
GeckoDriver.prototype.executeScript@chrome://remote/content/marionette/driver.js:665:30
despatch@chrome://remote/content/marionette/server.js:304:40
execute@chrome://remote/content/marionette/server.js:277:16
onPacket/<@chrome://remote/content/marionette/server.js:250:20
onPacket@chrome://remote/content/marionette/server.js:251:9
_onJSONObjectReady/<@chrome://remote/content/marionette/transport.js:502:20
Traceback (most recent call last):
File "/Users/tester/mozilla-central/testing/marionette/harness/marionette_harness/marionette_test/testcases.py", line 183, in run
self.setUp()
File "/Users/tester/mozilla-central/toolkit/mozapps/update/tests/marionette/test_no_window_update_restart.py", line 16, in setUp
self.marionette.execute_script("""
File "/Users/tester/mozilla-central/testing/marionette/client/marionette_driver/marionette.py", line 1716, in execute_script
rv = self._send_message("WebDriver:ExecuteScript", body, key="value")
File "/Users/tester/mozilla-central/testing/marionette/client/marionette_driver/decorators.py", line 27, in _
return func(*args, **kwargs)
File "/Users/tester/mozilla-central/testing/marionette/client/marionette_driver/marionette.py", line 668, in _send_message
self._handle_error(err)
File "/Users/tester/mozilla-central/testing/marionette/client/marionette_driver/marionette.py", line 680, in _handle_error
raise errors.lookup(error)(message, stacktrace=stacktrace)
Comment 3•2 years ago
|
||
Yes, the problem is that when a session is started with moz:windowless
there is no window selected by Marionette itself. Instead you would have to find open windows and select one yourself like:
window = self.marionette.window_handles[0]
self.marionette.switch_to_window(window)
It might be fine as well to let Marionette check for an already open browser window (as it would be the case for your test) and select it before the test gets started. I filed bug 1777956 for that, but the workaround should be fine for you right now.
Assignee | ||
Comment 4•2 years ago
|
||
It seems that the "browser-lastwindow-close-granted" observer is not entirely reliable about notifying when the last window was closed. Instead we will rely on "domwindowclosed" and checking if that was the last window, which seems to be more reliable.
Assignee | ||
Comment 5•2 years ago
|
||
Depends on D151859
Updated•2 years ago
|
Comment hidden (off-topic) |
Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 8•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/44e6f14f69e1
https://hg.mozilla.org/mozilla-central/rev/b787e5b41e0e
Description
•