Closed Bug 874028 Opened 7 years ago Closed 7 years ago

Debugger tests use load event on tab (and therefore favicon) rather than on tab's browser to detect pageload

Categories

(DevTools :: Debugger, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 24

People

(Reporter: Gijs, Assigned: Gijs)

References

Details

Attachments

(1 file)

The debugger's head.js addTab code contains this:

72   let tab = targetBrowser.selectedTab;
73   let win = tab.linkedBrowser.contentWindow;
74   let expectedReadyState = aURL == "about:blank" ? ["interactive", "complete"] : ["complete"];
75 
76   if (aOnload) {
77     let handler = function() {
78       if (tab.linkedBrowser.currentURI.spec != aURL ||
79           expectedReadyState.indexOf((win.document || {}).readyState) == -1) {
80         return;
81       }
82       tab.removeEventListener("load", handler, false);
83       executeSoon(aOnload);
84     }
85     tab.addEventListener("load", handler, false);
86   }

Unfortunately, the tab (which is just the tabbrowser's <tab> element) doesn't actually have load events, except for the tab's favicon. The fact that this currently works at all is probably mostly due to the expectedReadyState checking and a miracle. Because of how we remove empty favicons on the UX branch, it completely fails to work there. It should probably listen to the tab's linkedBrowser's load event instead.
Attached patch PatchSplinter Review
This fixes the UX branch, AFAICT. I've also updated the netmonitor test; I don't believe any other tests are using the same code.
Assignee: nobody → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Attachment #751672 - Flags: review?(past)
Comment on attachment 751672 [details] [diff] [review]
Patch

Review of attachment 751672 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks!
Attachment #751672 - Flags: review?(past) → review+
Pushed: https://hg.mozilla.org/integration/fx-team/rev/108c6b3bf66e

Thanks for the quick r+!
Whiteboard: [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/108c6b3bf66e
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 24
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.