Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Side by Side Diff: LayoutTests/push_messaging/push-messaging.html

Issue 209853010: [ABANDONED] Enable V8 Promises (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../resources/js-test.js"></script> 4 <script src="../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <script> 7 <script>
8 description('Tests for the Push API.'); 8 description('Tests for the Push API.');
9 9
10 if (!window.testRunner) 10 if (!window.testRunner)
11 debug('This test can not run without testRunner'); 11 debug('This test can not run without testRunner');
12 12
13 window.jsTestIsAsync = true; 13 window.jsTestIsAsync = true;
14 14
15 shouldBeTrue('!!navigator.push'); 15 shouldBeTrue('!!navigator.push');
16 shouldBeTrue('!!navigator.push.register'); 16 shouldBeTrue('!!navigator.push.register');
17 shouldBeEqualToString('String(navigator.push.register("senderId"))', '[object Pr omise]'); 17 shouldBe('navigator.push.register("senderId").constructor', 'Promise');
18 18
19 // Currently we have an empty implementation that always fails. 19 // Currently we have an empty implementation that always fails.
20 navigator.push.register('senderId').then(function successCallback() { 20 navigator.push.register('senderId').then(function successCallback() {
21 testFailed('Success callback invoked unexpectedly.'); 21 testFailed('Success callback invoked unexpectedly.');
22 finishJSTest(); 22 finishJSTest();
23 }, function errorCallback(e) { 23 }, function errorCallback(e) {
24 error = e; 24 error = e;
25 shouldBeEqualToString('error.name', 'AbortError'); 25 shouldBeEqualToString('error.name', 'AbortError');
26 finishJSTest(); 26 finishJSTest();
27 }); 27 });
28 28
29 </script> 29 </script>
30 </body> 30 </body>
31 </html> 31 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698