docshell/test/navigation/file_bug462076_3.html

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 <html>
michael@0 2 <head>
michael@0 3 <title>Bug 462076</title>
michael@0 4 <script>
michael@0 5 var srcs = [ "frame0.html",
michael@0 6 "frame1.html",
michael@0 7 "frame2.html",
michael@0 8 "frame3.html" ];
michael@0 9
michael@0 10 var checkCount = 0;
michael@0 11
michael@0 12 function makeFrame(index) {
michael@0 13 var ifr = document.createElement("iframe");
michael@0 14 ifr.src = srcs[index];
michael@0 15 ifr.onload = checkFrame;
michael@0 16 document.getElementById("container" + index).appendChild(ifr);
michael@0 17 }
michael@0 18
michael@0 19 function runTest() {
michael@0 20 var randomNumber = Math.floor(Math.random() * 4);
michael@0 21 for (var i = randomNumber; i < 4; ++i) {
michael@0 22 makeFrame(i);
michael@0 23 }
michael@0 24 for (var i = 0; i < randomNumber; ++i) {
michael@0 25 makeFrame(i);
michael@0 26 }
michael@0 27 }
michael@0 28
michael@0 29 function checkFrame(evt) {
michael@0 30 var ifr = evt.target;
michael@0 31 opener.ok(new String(ifr.contentWindow.location).indexOf(ifr.src) >= 0,
michael@0 32 "Wrong document loaded (" + ifr.src + ", " +
michael@0 33 ifr.contentWindow.location + ")!");
michael@0 34
michael@0 35 if (++checkCount == 4) {
michael@0 36 if (++opener.testCount == 10) {
michael@0 37 opener.nextTest();
michael@0 38 window.close();
michael@0 39 } else {
michael@0 40 window.location.reload();
michael@0 41 }
michael@0 42 }
michael@0 43 }
michael@0 44 </script>
michael@0 45 </head>
michael@0 46 <body onload="setTimeout(runTest, 0);">
michael@0 47 <div id="container0"></div>
michael@0 48 <div id="container1"></div>
michael@0 49 <div id="container2"></div>
michael@0 50 <div id="container3"></div>
michael@0 51 </body>
michael@0 52 </html>

mercurial