gecko-dev/browser/base/content/test/general/browser_findbarClose.js
Gijs Kruitbosch d2ebbb38df Bug 1358815 - remove sync reflow from find bar initialization, r=jaws
This removes the sync reflow from almost all cases. The only case where we keep it is when a keypress
caught in content triggers a sync message to the parent process. We should clean this up in bug 1371523.

I've tried to fix the tests, but a lot of them seem to be disabled anyway...

MozReview-Commit-ID: 9k36p7q8MKy

--HG--
extra : rebase_source : 311ee41ba9456a5c5d58b81a0cfa999bcef0027e
2018-03-12 14:01:44 +00:00

37 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);
});
newTab.linkedBrowser.loadURI("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();
});