Closed Bug 1707874 Opened 4 years ago Closed 4 years ago

Stop using will-navigate and navigate in netmonitor test helper (as well as connector)

Categories

(DevTools :: Netmonitor, enhancement, P3)

enhancement

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1708635

People

(Reporter: ochameau, Unassigned)

References

(Blocks 2 open bugs)

Details

Attachments

(1 obsolete file)

Once we enable the JSWindowActor based targets, will-navigate and navigate starts missing.
We should get away from these events and especially navigate which is very unreliable.

These events are used in tests over here, and break when enabling bug 1698891:
https://searchfox.org/mozilla-central/rev/6cbe34b441f7c7c29cd1e5f0e19c7000142f1423/devtools/client/netmonitor/test/head.js#202-210

function waitForNavigation(target) {
  return new Promise(resolve => {
    target.once("will-navigate", () => {
      target.once("navigate", () => {
        resolve();
      });
    });
  });
}

Here we should rather only wait for the next DOCUMENT_EVENT's dom-complete.

We should probably also do the exact same thing in this production code:
https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/src/connector/index.js#463-468

    // Waits for a series of "navigation start" and "navigation stop" events.
    const waitForNavigation = async () => {
      await this.currentTarget.once("will-navigate");
      await this.currentTarget.once("navigate");
    };
Severity: -- → S3
Priority: -- → P3
Attachment #9218630 - Attachment is obsolete: true

Actually, bug 1708635 will cover this.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: