dom/tests/mochitest/webapps/cross_origin.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   <meta charset="utf-8">
     5   <title>Cross Origin Helper</title>
     6   <script type="application/javascript" src="head.js"></script>
     7 </head>
     8 <body>
     9 <script type="application/javascript">
    11 /**
    12  * Install an app, check that getSelf() works, and then tell the test page
    13  * to continue the tests.
    14  *
    15  * This page loads on a different origin than the one for the test page,
    16  * which enables that page to check the behavior of various API calls when apps
    17  * have been installed from multiple origins.
    18  */
    20 var parent = SpecialPowers.wrap(window).parent;
    22 confirmNextInstall();
    23 navigator.mozApps.install(parent.url2, null).onsuccess = function onInstall() {
    24   // Give the test page a reference to the installed app, so it can uninstall it
    25   // after it finishes the tests.
    26   parent.app2 = this.result;
    28   navigator.mozApps.getSelf().onsuccess = function onGetSelf() {
    29     parent.ok(this.result == null, "getSelf() from app's origin returns null if called from a browser");
    31     // Tell the test page to continue the tests.
    32     parent.postMessage("next", "*");
    33   }
    34 }
    36 </script>
    37 </body>
    38 </html>

mercurial