dom/browser-element/mochitest/file_browserElement_Open1.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 <body>
michael@0 3 <script>
michael@0 4
michael@0 5 // Because this file is inside <iframe mozbrowser>, the alert() calls below
michael@0 6 // don't trigger actual dialogs. Instead, the document which contans the
michael@0 7 // iframe receives mozbrowsershowmodalprompt events, which the document uses
michael@0 8 // to determine test success/failure.
michael@0 9
michael@0 10 function is(x, y, reason) {
michael@0 11 if (x === y) {
michael@0 12 alert("success: " + x + " === " + y + ", " + reason);
michael@0 13 }
michael@0 14 else {
michael@0 15 alert("failure: " + x + " !== " + y + ", " + reason);
michael@0 16 }
michael@0 17 }
michael@0 18
michael@0 19 function ok(bool, reason) {
michael@0 20 alert((bool ? "success: " : "failure: ") + reason);
michael@0 21 }
michael@0 22
michael@0 23 // Send "dialog=1" as a test for bug 783644. It shouldn't have any effect.
michael@0 24 var w = window.open("file_browserElement_Open2.html", "name", "dialog=1");
michael@0 25 w.addEventListener("load", function() {
michael@0 26 ok(true, "got load");
michael@0 27 is(w.opener, window, 'opener property');
michael@0 28 is(w.location.href, location.href.replace('Open1', 'Open2'), 'correct location');
michael@0 29 is(w.document.getElementById('testElem').innerHTML, 'test', 'elem innerHTML');
michael@0 30 alert("finish");
michael@0 31 });
michael@0 32 </script>
michael@0 33 </body>
michael@0 34 </html>

mercurial