docshell/test/navigation/file_bug462076_1.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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>
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 <script>
michael@0 52 runTest();
michael@0 53 </script>
michael@0 54 </body>
michael@0 55 </html>

mercurial