browser_ext_devtools_inspectedWindow_targetSwitch.js fails with server targets
Categories
(WebExtensions :: Developer Tools, defect)
Tracking
(Fission Milestone:MVP, firefox92 fixed)
Tracking | Status | |
---|---|---|
firefox92 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
Details
(Whiteboard: dt-fission-m3-mvp)
Attachments
(1 file)
$ ./mach mochitest --headless browser/components/extensions/test/browser/browser_ext_devtools_inspectedWindow_targetSwitch.js
This test fails for various reason, but the one I'm trying to fix is the fact that it does reload too quickly.
The test is listening for the target-switched on the toolbox's commands:
https://searchfox.org/mozilla-central/rev/a9db89754fb507254cb8422e5a00af7c10d98264/browser/components/extensions/test/browser/browser_ext_devtools_inspectedWindow_targetSwitch.js#31-33
const onSwitched = toolbox.commands.targetCommand.once("switched-target");
BrowserTestUtils.loadURI(tab.linkedBrowser, uri);
await onSwitched;
Whereas it should also or instead listen for target to be switched on the distinct commands
used by WebExt codebase. The one which does the reload:
https://searchfox.org/mozilla-central/source/browser/components/extensions/parent/ext-devtools-inspectedWindow.js#42-48
const commands = await context.getDevToolsCommands();
commands.inspectedWindowCommand.reload(callerInfo, {
ignoreCache,
userAgent,
injectedScript,
});
Another angle to tackle that would be to have the devtools.inspectedWindow.reload
to either return a promise which would resolve only once reloaded ? Or have it to emit an event which the test can listen to.
Because clearly, the test isn't waiting for the full reload of the page before proceeding with the next.
Assignee | ||
Comment 1•3 years ago
|
||
Updated•3 years ago
|
Updated•3 years ago
|
Comment 4•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/f21ddd4afe0e
https://hg.mozilla.org/mozilla-central/rev/4aff2ad98df1
Description
•