docshell/test/chrome/test_bug454235.xul

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 <?xml version="1.0"?>
michael@0 2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
michael@0 3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
michael@0 4 <!--
michael@0 5 https://bugzilla.mozilla.org/show_bug.cgi?id=454235
michael@0 6 -->
michael@0 7 <window title="Mozilla Bug 454235"
michael@0 8 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
michael@0 9 <script type="application/javascript"
michael@0 10 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
michael@0 11
michael@0 12 <!-- test results are displayed in the html:body -->
michael@0 13 <body xmlns="http://www.w3.org/1999/xhtml">
michael@0 14 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=454235"
michael@0 15 target="_blank">Mozilla Bug 454235</a>
michael@0 16 </body>
michael@0 17
michael@0 18 <!-- test code goes here -->
michael@0 19 <script type="application/javascript"><![CDATA[
michael@0 20
michael@0 21 /** Test for Bug 454235 **/
michael@0 22 SimpleTest.waitForExplicitFinish();
michael@0 23
michael@0 24 SimpleTest.waitForFocus(doTest);
michael@0 25
michael@0 26 function doTest() {
michael@0 27 var shownBrowser = document.getElementById("shownBrowser");
michael@0 28 var hiddenBrowser = document.getElementById("hiddenBrowser");
michael@0 29 var offScreenBrowser = document.getElementById("offScreenBrowser");
michael@0 30 var offScreenSubBrowser = offScreenBrowser.contentDocument.getElementById("topBrowser");
michael@0 31 var offScreenBurriedBrowser = offScreenBrowser.contentDocument.getElementById("burriedBrowser");
michael@0 32
michael@0 33 hiddenBrowser.contentWindow.focus();
michael@0 34 ok(!hiddenBrowser.contentDocument.hasFocus(),"hidden browser is visible");
michael@0 35
michael@0 36 offScreenBrowser.docShell.isOffScreenBrowser = true;
michael@0 37 offScreenBrowser.contentWindow.focus();
michael@0 38 ok(offScreenBrowser.contentDocument.hasFocus(),"offscreen browser is not visible");
michael@0 39
michael@0 40 offScreenSubBrowser.contentWindow.focus();
michael@0 41 todo(offScreenSubBrowser.contentDocument.hasFocus(),"visible browser in offscreen browser is not visible");
michael@0 42
michael@0 43 offScreenBurriedBrowser.contentWindow.focus();
michael@0 44 ok(!offScreenBurriedBrowser.contentDocument.hasFocus(),"hidden browser in offscreen browser is visible");
michael@0 45
michael@0 46 SimpleTest.finish();
michael@0 47 }
michael@0 48
michael@0 49
michael@0 50
michael@0 51 ]]></script>
michael@0 52 <box flex="1" style="visibility: hidden; border:5px black solid">
michael@0 53 <browser style="border:5px blue solid" id="hiddenBrowser" src="bug454235-subframe.xul"/>
michael@0 54 <browser style="border:5px yellow solid" id="offScreenBrowser" src="bug454235-subframe.xul"/>
michael@0 55 </box>
michael@0 56 </window>

mercurial