OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <body> |
| 4 <script src="../resources/js-test.js"></script> |
| 5 <script> |
| 6 description("Test installed app API definitions."); |
| 7 |
| 8 if (!window.testRunner) |
| 9 debug('This test cannot be run without the TestRunner'); |
| 10 |
| 11 gc(); |
| 12 jsTestIsAsync = true; |
| 13 testRunner.waitUntilDone(); |
| 14 |
| 15 var installedApps; |
| 16 function getInstalledRelatedAppsSuccess(installedAppsArray) { |
| 17 debug('getInstalledRelatedAppsSuccess invoked'); |
| 18 |
| 19 installedApps = installedAppsArray; |
| 20 shouldBeDefined("installedApps"); |
| 21 shouldBeNonNull("installedApps"); |
| 22 shouldBeTrue("Array.isArray(installedApps)"); |
| 23 |
| 24 shouldBe('installedApps.length', '0'); |
| 25 setTimeout(finishJSTest, 0); |
| 26 } |
| 27 |
| 28 function getInstalledRelatedAppsFailure() { |
| 29 testFailed('failed to successfully resolve the promise'); |
| 30 setTimeout(finishJSTest, 0); |
| 31 } |
| 32 |
| 33 promise = navigator.getInstalledRelatedApps(); |
| 34 shouldBeDefined("promise"); |
| 35 shouldBeDefined("promise.then"); |
| 36 promise.then(getInstalledRelatedAppsSuccess, getInstalledRelatedAppsFailure); |
| 37 </script> |
| 38 </body> |
| 39 </html> |
OLD | NEW |