mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 914438. Prevent propagation of SSTabRestored events in tests when we close the relevant tab. r=dao
This commit is contained in:
parent
f05f2d9054
commit
74048d8b72
@ -28,6 +28,9 @@ function test() {
|
||||
is(newBrowser.contentWindow.scrollY, 1200, "still scrolled vertically");
|
||||
|
||||
gBrowser.removeTab(newTab);
|
||||
// Call stopPropagation on the event so we won't fire the
|
||||
// tabbrowser's SSTabRestored listeners.
|
||||
e.stopPropagation();
|
||||
|
||||
finish();
|
||||
}, true);
|
||||
|
@ -24,17 +24,24 @@ function test() {
|
||||
tabState.entries[0].referrer = REFERRER2;
|
||||
ss.setTabState(tab, JSON.stringify(tabState));
|
||||
|
||||
tab.addEventListener("SSTabRestored", function() {
|
||||
tab.addEventListener("SSTabRestored", function(e) {
|
||||
tab.removeEventListener("SSTabRestored", arguments.callee, true);
|
||||
is(window.content.document.referrer, REFERRER2, "document.referrer matches referrer set via setTabState.");
|
||||
|
||||
gBrowser.removeTab(tab);
|
||||
// Call stopPropagation on the event so we won't fire the
|
||||
// tabbrowser's SSTabRestored listeners.
|
||||
e.stopPropagation();
|
||||
|
||||
let newTab = ss.undoCloseTab(window, 0);
|
||||
newTab.addEventListener("SSTabRestored", function() {
|
||||
newTab.addEventListener("SSTabRestored", function(e) {
|
||||
newTab.removeEventListener("SSTabRestored", arguments.callee, true);
|
||||
|
||||
is(window.content.document.referrer, REFERRER2, "document.referrer is still correct after closing and reopening the tab.");
|
||||
gBrowser.removeTab(newTab);
|
||||
// Call stopPropagation on the event so we won't fire the
|
||||
// tabbrowser's SSTabRestored listeners.
|
||||
e.stopPropagation();
|
||||
|
||||
finish();
|
||||
}, true);
|
||||
|
@ -98,6 +98,9 @@ function testTabRestoreData(aFormData, aExpectedValues, aCallback) {
|
||||
|
||||
// clean up
|
||||
gBrowser.removeTab(tab);
|
||||
// Call stopPropagation on the event so we won't fire the
|
||||
// tabbrowser's SSTabRestored listeners.
|
||||
aEvent.stopPropagation();
|
||||
aCallback();
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user