dom/tests/mochitest/general/file_showModalDialog.html

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

michael@0 1 <!DOCTYPE html>
michael@0 2 <html>
michael@0 3 <head>
michael@0 4 <script>
michael@0 5 function go() {
michael@0 6 is(SpecialPowers.wrap(window).location.toString(), location.toString(), "sanity");
michael@0 7 ok("returnValue" in window && "dialogArguments" in window, "We are modal");
michael@0 8 var iwin = document.getElementById('ifr').contentWindow;
michael@0 9 is(SpecialPowers.Cu.getClassName(iwin, /* aUnwrap = */ true), "Window", "Descendant frames should not be modal");
michael@0 10
michael@0 11 if (location.origin != "http://mochi.test:8888") {
michael@0 12 is(window.dialogArguments, undefined,
michael@0 13 "dialogArguments should be undefined cross-origin: " + location.origin);
michael@0 14 }
michael@0 15
michael@0 16 window.returnValue = "rv: " + window.dialogArguments;
michael@0 17
michael@0 18 // Allow for testing navigations in series.
michael@0 19 if (location.search == "") {
michael@0 20 window.close();
michael@0 21 } else {
michael@0 22 var origins = location.search.split('?')[1].split(',');
michael@0 23 var newsearch = '?' + origins.splice(1).join(',');
michael@0 24 var newurl = location.toString().replace(location.origin, origins[0])
michael@0 25 .replace(location.search, newsearch);
michael@0 26 location = newurl;
michael@0 27 }
michael@0 28
michael@0 29 }
michael@0 30 </script>
michael@0 31 </head>
michael@0 32 <body onload="opener.postMessage('dosetup', '*');">
michael@0 33 <iframe id="ifr"></iframe>
michael@0 34 </body>
michael@0 35 </html>

mercurial