webapprt/test/content/webapprt_sample.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>
     3 <!--
     4   This is a sample WebappRT content mochitest.  Since its name is prefixed with
     5   webapprt_, this file is picked up by the Mochitest harness.  It's just a plain
     6   mochitest that runs in the app browser within an app window.
     7 -->
     9 <html>
    10   <head>
    11     <meta charset="utf-8">
    12     <script src="/tests/SimpleTest/SimpleTest.js"></script>
    13     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    14   </head>
    15   <body>
    16     <p id="display">
    17       This is the sample WebappRT content mochitest.
    18     </p>
    19     <div id="content" style="display: none"></div>
    20     <pre id="test">
    21       <script>
    23 SimpleTest.waitForExplicitFinish();
    25 SpecialPowers.setAllAppsLaunchable(true);
    27 ok(true, "true is true!");
    29 var self = navigator.mozApps.getSelf();
    30 self.onsuccess = function () {
    31   ok(true, "onsuccess should be called");
    32   ok(self.result, "result should be nonnull");
    33   ok(self.result.manifest, "manifest should be nonnull");
    34   is(self.result.manifest.name, "WebappRT Mochitest Webapp",
    35      "manifest.name");
    36   SimpleTest.finish();
    37 };
    38 self.onerror = function () {
    39   ok(false, "onerror should not be called");
    40   SimpleTest.finish();
    41 };
    43       </script>
    44     </pre>
    45   </body>
    46 </html>

mercurial