fune/browser/base/content/test/general/browser_findbarClose.js
Jonathan Kingston 555f89c8d7 Bug 1485305 - browser/ tests Ensure loadURI always passes a triggeringPrincipal() r=Mossop
Differential Revision: https://phabricator.services.mozilla.com/D4552

--HG--
extra : source : 2cf17e4974823d09d0fdd1aef64e69e840b288a1
extra : intermediate-source : 4771e6948a78507aa95a56e5b324d87dc82e9009
2018-08-29 15:44:56 +01:00

36 lines
1.1 KiB
JavaScript

/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
// Tests find bar auto-close behavior
var newTab;
add_task(async function findbar_test() {
waitForExplicitFinish();
newTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
let promise = ContentTask.spawn(newTab.linkedBrowser, null, async function() {
await ContentTaskUtils.waitForEvent(this, "DOMContentLoaded", false);
});
BrowserTestUtils.loadURI(newTab.linkedBrowser, "http://example.com/browser/" +
"browser/base/content/test/general/test_bug628179.html");
await promise;
await gFindBarPromise;
gFindBar.open();
await new ContentTask.spawn(newTab.linkedBrowser, null, async function() {
let iframe = content.document.getElementById("iframe");
let awaitLoad = ContentTaskUtils.waitForEvent(iframe, "load", false);
iframe.src = "http://example.org/";
await awaitLoad;
});
ok(!gFindBar.hidden, "the Find bar isn't hidden after the location of a " +
"subdocument changes");
gFindBar.close();
gBrowser.removeTab(newTab);
finish();
});