Closed Bug 1712745 Opened 3 years ago Closed 3 years ago

Make browser/components/extensions/test/browser/browser_ext_tabs_readerMode.js work with Fission and BFCache

Categories

(Core :: DOM: Navigation, defect, P3)

defect

Tracking

()

RESOLVED FIXED
90 Branch
Fission Milestone M7a
Tracking Status
firefox90 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

No description provided.
Flags: needinfo?(emilio)
Assignee: nobody → emilio
Status: NEW → ASSIGNED
Fission Milestone: --- → M7a

So what's going on is that these two lines of code: https://searchfox.org/mozilla-central/rev/202250ee5931648185c8abb3061d738b15b64067/docshell/base/nsDocShell.cpp#1224-1225 are causing two onStateChange notifications, and the later one cause an extra tabUpdated message here: https://searchfox.org/mozilla-central/rev/202250ee5931648185c8abb3061d738b15b64067/browser/components/extensions/test/browser/browser_ext_tabs_readerMode.js#68

When the document comes from the bfcache we get:

  • onLocationChange() with isLoadingDocument = false
  • onStateChange() with isLoadingDocument = true (from the first line)
  • onStateChange() with isLoadingDocument = false (from the second one)

So the test sees the later one and triggers an extra tabUpdated message, then proceeds while it thinks it has a different page loaded and it all goes downhill from there.

Olli, Is the order of notifications above expected? If so, I can just fix the test to wait for the right URL. If not, I can look into fixing that.

Flags: needinfo?(bugs)

(+peter in case he has the nsIWebProgress notification order more fresh).

In any case, no rush. I need to go for the day now, but I'll double-check the notification order with the old bfcache. There's a chance that the test is using the new bfcache but with fission disabled it's not using the bfcache at all (in which case if the notification order matches then we can probably just fix the test).

Flags: needinfo?(peterv)
Flags: needinfo?(emilio)

In the case of bfcache because the location change in that case comes
with a "complete" state, which confuses the test.

I guess the question is that what notifications we get in the old bfcache.

Flags: needinfo?(bugs)
Flags: needinfo?(emilio)

So that the location change doesn't appear to happen on an
already-loaded document. This matches the old bfcache.

Attachment #9223649 - Attachment is obsolete: true
Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4ba1ab810f7c
Fix notification order when coming out of the bfcache. r=smaug
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
Flags: needinfo?(peterv)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: