dom/tests/mochitest/general/file_showModalDialog.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.

     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