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

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

Issue 735293005: Push API: delete the old layout tests [switchover 1/6] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/push_messaging/push-messaging-api-surface.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../resources/js-test.js"></script>
5 </head>
6 <body>
7 <script>
8 description('Tests for the Push API.');
9
10 if (!window.testRunner)
11 debug('This test can not run without testRunner');
12
13 window.jsTestIsAsync = true;
14
15 function testPushRegistrationError() {
16 window.testRunner.setMockPushClientError('message');
17 navigator.push.register().then(function() {
18 testFailed('Success callback invoked unexpectedly.');
19 testPushRegistrationSuccess();
20 }, function(e) {
21 error = e;
22 shouldBeEqualToString('error.name', 'AbortError');
23 testPushRegistrationSuccess();
24 });
25 }
26 testPushRegistrationError();
27
28 function testPushRegistrationSuccess() {
29 window.testRunner.setMockPushClientSuccess('endpoint', 'registrationId');
30 navigator.push.register().then(function(reg) {
31 registration = reg;
32 shouldBeEqualToString('registration.pushEndpoint', 'endpoint');
33 shouldBeEqualToString('registration.pushRegistrationId', 'registrationId ');
34 testPushHasPermission();
35 }, function(e) {
36 testFailed('Error callback invoked unexpectedly.');
37 finishJSTest();
38 });
39 }
40
41 function testPushHasPermission() {
42 navigator.push.hasPermission().then(function(permissionStatus) {
43 status = permissionStatus;
44 shouldBeEqualToString('status', 'granted');
45 finishJSTest();
46 }, function() {
47 testFailed('Error callback invoked unexpectedly.');
48 finishJSTest();
49 });
50 }
51
52 </script>
53 </body>
54 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/push_messaging/push-messaging-api-surface.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698