Skip to content

Commit

Permalink
Bug 1126089 - Add test for pageload event on browser element when tab…
Browse files Browse the repository at this point in the history
… closed
  • Loading branch information
rmottola committed Jul 5, 2019
1 parent 167ebbd commit f2011e6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dom/base/test/browser.ini
Expand Up @@ -7,6 +7,8 @@ skip-if = e10s # Bug ?????? - test directly touches content (contentWindow.ifram
[browser_bug902350.js]
skip-if = e10s # Bug ?????? - test e10s utils don't support load events from iframe etc, which this test relies on.
[browser_messagemanager_loadprocessscript.js]
[browser_pagehide_on_tab_close.js]
skip-if = e10s # this tests non-e10s behavior. it's not expected to work in e10s.
[browser_messagemanager_unload.js]
[browser_state_notifications.js]
# skip-if = e10s # Bug ?????? - content-document-* notifications come while document's URI is still about:blank, but test expects real URL.
Expand Down
17 changes: 17 additions & 0 deletions dom/base/test/browser_pagehide_on_tab_close.js
@@ -0,0 +1,17 @@
function test() {
waitForExplicitFinish();

var tab = gBrowser.addTab();
gBrowser.selectedTab = tab;

tab.linkedBrowser.addEventListener("load", function onload() {
tab.linkedBrowser.removeEventListener("load", onload);

tab.linkedBrowser.addEventListener("pagehide", function() {
ok(true, "got page hide event");
finish();
});

executeSoon(() => { gBrowser.removeTab(tab); });
}, true);
}

0 comments on commit f2011e6

Please sign in to comment.