browser/components/sessionstore/test/browser_459906_sample.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 <!-- Testcase originally by David Bloom <bloom@google.com> -->
michael@0 2
michael@0 3 <!DOCTYPE html>
michael@0 4 <title>Test for bug 459906</title>
michael@0 5
michael@0 6 <body>
michael@0 7 <iframe src="data:text/html;charset=utf-8,not_on_localhost"></iframe>
michael@0 8 <iframe></iframe>
michael@0 9
michael@0 10 <script type="application/javascript">
michael@0 11 var loadCount = 0;
michael@0 12 frames[0].addEventListener("DOMContentLoaded", handleLoad, false);
michael@0 13 frames[1].addEventListener("DOMContentLoaded", handleLoad, false);
michael@0 14 function handleLoad() {
michael@0 15 if (++loadCount < 2)
michael@0 16 return;
michael@0 17 frames[0].removeEventListener("DOMContentLoaded", handleLoad, false);
michael@0 18 frames[1].removeEventListener("DOMContentLoaded", handleLoad, false);
michael@0 19 frames[0].document.designMode = "on";
michael@0 20 frames[0].document.__defineGetter__("designMode", function() {
michael@0 21 // inject a cross domain file ...
michael@0 22 var documentInjected = false;
michael@0 23 document.getElementsByTagName("iframe")[0].onload =
michael@0 24 function() { documentInjected = true; };
michael@0 25 frames[0].location = "browser_459906_empty.html";
michael@0 26
michael@0 27 // ... and ensure that it has time to load
michael@0 28 for (var c = 0; !documentInjected && c < 20; c++) {
michael@0 29 var r = new XMLHttpRequest();
michael@0 30 r.open("GET", location.href, false);
michael@0 31 r.overrideMimeType("text/plain");
michael@0 32 r.send(null);
michael@0 33 }
michael@0 34
michael@0 35 return "on";
michael@0 36 });
michael@0 37
michael@0 38 frames[1].document.designMode = "on";
michael@0 39 };
michael@0 40 </script>
michael@0 41 </body>

mercurial