michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: // Tests find bar auto-close behavior michael@0: michael@0: let newTab, iframe; michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: newTab = gBrowser.addTab("about:blank"); michael@0: newTab.linkedBrowser.addEventListener("DOMContentLoaded", michael@0: prepareTestFindBarStaysOpenOnSubdocumentLocationChange, false); michael@0: newTab.linkedBrowser.contentWindow.location = "http://example.com/browser/" + michael@0: "browser/base/content/test/general/test_bug628179.html"; michael@0: } michael@0: michael@0: function prepareTestFindBarStaysOpenOnSubdocumentLocationChange() { michael@0: newTab.linkedBrowser.removeEventListener("DOMContentLoaded", michael@0: prepareTestFindBarStaysOpenOnSubdocumentLocationChange, false); michael@0: michael@0: gFindBar.open(); michael@0: michael@0: iframe = newTab.linkedBrowser.contentDocument.getElementById("iframe"); michael@0: iframe.addEventListener("load", michael@0: testFindBarStaysOpenOnSubdocumentLocationChange, false); michael@0: iframe.src = "http://example.org/"; michael@0: } michael@0: michael@0: function testFindBarStaysOpenOnSubdocumentLocationChange() { michael@0: iframe.removeEventListener("load", michael@0: testFindBarStaysOpenOnSubdocumentLocationChange, false); michael@0: michael@0: ok(!gFindBar.hidden, "the Find bar isn't hidden after the location of a " + michael@0: "subdocument changes"); michael@0: michael@0: gFindBar.close(); michael@0: gBrowser.removeTab(newTab); michael@0: finish(); michael@0: } michael@0: