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.

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

mercurial