OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../resources/js-test.js"></script> |
| 4 </head> |
| 5 <body> |
| 6 <script> |
| 7 description('Tests for the Push API.'); |
| 8 |
| 9 if (!window.testRunner) |
| 10 debug('This test can not run without testRunner'); |
| 11 |
| 12 window.jsTestIsAsync = true; |
| 13 |
| 14 shouldBeTrue('!!navigator.push'); |
| 15 shouldBeTrue('!!navigator.push.register'); |
| 16 shouldBe('String(navigator.push.register("senderId"))', '"[object Promise]"'); |
| 17 |
| 18 // Currently we have an empty implementation that always fails. |
| 19 navigator.push.register('senderId').then(function successCallback() { |
| 20 testFailed('Success callback invoked unexpectedly.'); |
| 21 finishJSTest(); |
| 22 }, function errorCallback(e) { |
| 23 error = e; |
| 24 shouldBeNull('error'); |
| 25 finishJSTest(); |
| 26 }); |
| 27 |
| 28 </script> |
| 29 </body> |
| 30 </html> |
OLD | NEW |