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.
michael@0 | 1 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | http://creativecommons.org/publicdomain/zero/1.0/ */ |
michael@0 | 3 | |
michael@0 | 4 | // Tests find bar auto-close behavior |
michael@0 | 5 | |
michael@0 | 6 | let newTab, iframe; |
michael@0 | 7 | |
michael@0 | 8 | function test() { |
michael@0 | 9 | waitForExplicitFinish(); |
michael@0 | 10 | newTab = gBrowser.addTab("about:blank"); |
michael@0 | 11 | newTab.linkedBrowser.addEventListener("DOMContentLoaded", |
michael@0 | 12 | prepareTestFindBarStaysOpenOnSubdocumentLocationChange, false); |
michael@0 | 13 | newTab.linkedBrowser.contentWindow.location = "http://example.com/browser/" + |
michael@0 | 14 | "browser/base/content/test/general/test_bug628179.html"; |
michael@0 | 15 | } |
michael@0 | 16 | |
michael@0 | 17 | function prepareTestFindBarStaysOpenOnSubdocumentLocationChange() { |
michael@0 | 18 | newTab.linkedBrowser.removeEventListener("DOMContentLoaded", |
michael@0 | 19 | prepareTestFindBarStaysOpenOnSubdocumentLocationChange, false); |
michael@0 | 20 | |
michael@0 | 21 | gFindBar.open(); |
michael@0 | 22 | |
michael@0 | 23 | iframe = newTab.linkedBrowser.contentDocument.getElementById("iframe"); |
michael@0 | 24 | iframe.addEventListener("load", |
michael@0 | 25 | testFindBarStaysOpenOnSubdocumentLocationChange, false); |
michael@0 | 26 | iframe.src = "http://example.org/"; |
michael@0 | 27 | } |
michael@0 | 28 | |
michael@0 | 29 | function testFindBarStaysOpenOnSubdocumentLocationChange() { |
michael@0 | 30 | iframe.removeEventListener("load", |
michael@0 | 31 | testFindBarStaysOpenOnSubdocumentLocationChange, false); |
michael@0 | 32 | |
michael@0 | 33 | ok(!gFindBar.hidden, "the Find bar isn't hidden after the location of a " + |
michael@0 | 34 | "subdocument changes"); |
michael@0 | 35 | |
michael@0 | 36 | gFindBar.close(); |
michael@0 | 37 | gBrowser.removeTab(newTab); |
michael@0 | 38 | finish(); |
michael@0 | 39 | } |
michael@0 | 40 |