1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/webapprt/test/content/webapprt_sample.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,46 @@ 1.4 +<!DOCTYPE HTML> 1.5 + 1.6 +<!-- 1.7 + This is a sample WebappRT content mochitest. Since its name is prefixed with 1.8 + webapprt_, this file is picked up by the Mochitest harness. It's just a plain 1.9 + mochitest that runs in the app browser within an app window. 1.10 +--> 1.11 + 1.12 +<html> 1.13 + <head> 1.14 + <meta charset="utf-8"> 1.15 + <script src="/tests/SimpleTest/SimpleTest.js"></script> 1.16 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.17 + </head> 1.18 + <body> 1.19 + <p id="display"> 1.20 + This is the sample WebappRT content mochitest. 1.21 + </p> 1.22 + <div id="content" style="display: none"></div> 1.23 + <pre id="test"> 1.24 + <script> 1.25 + 1.26 +SimpleTest.waitForExplicitFinish(); 1.27 + 1.28 +SpecialPowers.setAllAppsLaunchable(true); 1.29 + 1.30 +ok(true, "true is true!"); 1.31 + 1.32 +var self = navigator.mozApps.getSelf(); 1.33 +self.onsuccess = function () { 1.34 + ok(true, "onsuccess should be called"); 1.35 + ok(self.result, "result should be nonnull"); 1.36 + ok(self.result.manifest, "manifest should be nonnull"); 1.37 + is(self.result.manifest.name, "WebappRT Mochitest Webapp", 1.38 + "manifest.name"); 1.39 + SimpleTest.finish(); 1.40 +}; 1.41 +self.onerror = function () { 1.42 + ok(false, "onerror should not be called"); 1.43 + SimpleTest.finish(); 1.44 +}; 1.45 + 1.46 + </script> 1.47 + </pre> 1.48 + </body> 1.49 +</html>