Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
4 // Tests find bar auto-close behavior
6 let newTab, iframe;
8 function test() {
9 waitForExplicitFinish();
10 newTab = gBrowser.addTab("about:blank");
11 newTab.linkedBrowser.addEventListener("DOMContentLoaded",
12 prepareTestFindBarStaysOpenOnSubdocumentLocationChange, false);
13 newTab.linkedBrowser.contentWindow.location = "http://example.com/browser/" +
14 "browser/base/content/test/general/test_bug628179.html";
15 }
17 function prepareTestFindBarStaysOpenOnSubdocumentLocationChange() {
18 newTab.linkedBrowser.removeEventListener("DOMContentLoaded",
19 prepareTestFindBarStaysOpenOnSubdocumentLocationChange, false);
21 gFindBar.open();
23 iframe = newTab.linkedBrowser.contentDocument.getElementById("iframe");
24 iframe.addEventListener("load",
25 testFindBarStaysOpenOnSubdocumentLocationChange, false);
26 iframe.src = "http://example.org/";
27 }
29 function testFindBarStaysOpenOnSubdocumentLocationChange() {
30 iframe.removeEventListener("load",
31 testFindBarStaysOpenOnSubdocumentLocationChange, false);
33 ok(!gFindBar.hidden, "the Find bar isn't hidden after the location of a " +
34 "subdocument changes");
36 gFindBar.close();
37 gBrowser.removeTab(newTab);
38 finish();
39 }