|
1 <!DOCTYPE HTML> |
|
2 |
|
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 --> |
|
8 |
|
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> |
|
22 |
|
23 SimpleTest.waitForExplicitFinish(); |
|
24 |
|
25 SpecialPowers.setAllAppsLaunchable(true); |
|
26 |
|
27 ok(true, "true is true!"); |
|
28 |
|
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 }; |
|
42 |
|
43 </script> |
|
44 </pre> |
|
45 </body> |
|
46 </html> |