Closed Bug 1722749 Opened 3 years ago Closed 3 years ago

browser_ext_devtools_inspectedWindow_targetSwitch.js fails with server targets

Categories

(WebExtensions :: Developer Tools, defect)

defect

Tracking

(Fission Milestone:MVP, firefox92 fixed)

RESOLVED FIXED
92 Branch
Fission Milestone MVP
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: nobody → poirot.alex
Status: NEW → ASSIGNED
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f21ddd4afe0e [devtools] Fix browser_ext_devtools_inspectedWindow_targetSwitch.js with server targets. r=rpl
Pushed by imoraru@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4aff2ad98df1 fix eslint failures. a=lint-fix CLOSED TREE
Fission Milestone: --- → MVP
Whiteboard: dt-fission-m3-mvp
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 92 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: