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

Side by Side Diff: chrome/test/data/push_messaging/test.html

Issue 663813002: Clean up deprecated Web Push API code-paths. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/push-remove-senderId
Patch Set: rebase Created 6 years, 2 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
« no previous file with comments | « no previous file | content/renderer/push_messaging_dispatcher.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Push API Test</title> 4 <title>Push API Test</title>
5 <link rel="manifest" href="manifest.json"> 5 <link rel="manifest" href="manifest.json">
6 <script> 6 <script>
7 function sendResultToTest(result) { 7 function sendResultToTest(result) {
8 console.log(result); 8 console.log(result);
9 if (window.domAutomationController) { 9 if (window.domAutomationController) {
10 domAutomationController.send('' + result); 10 domAutomationController.send('' + result);
11 } 11 }
12 } 12 }
13 13
14 function sendErrorToTest(error) { 14 function sendErrorToTest(error) {
15 sendResultToTest(error.name + ' - ' + error.message); 15 sendResultToTest(error.name + ' - ' + error.message);
16 } 16 }
17 17
18 function registerServiceWorker() { 18 function registerServiceWorker() {
19 navigator.serviceWorker.register('service_worker.js').then(function(swRegi stration) { 19 navigator.serviceWorker.register('service_worker.js').then(function(swRegi stration) {
20 console.log(swRegistration); 20 console.log(swRegistration);
21 sendResultToTest('ok'); 21 sendResultToTest('ok');
22 }, sendErrorToTest); 22 }, sendErrorToTest);
23 } 23 }
24 24
25 function registerPush() { 25 function registerPush() {
26 navigator.serviceWorker.ready.then(function() { 26 navigator.serviceWorker.ready.then(function() {
27 // TODO(peter): Remove the argument once Blink no longer requires it. 27 navigator.push.register().then(function(pushRegistration) {
28 navigator.push.register('DEPRECATED').then(function(pushRegistration) {
29 sendResultToTest(pushRegistration.pushEndpoint + ' - ' + pushRegistrat ion.pushRegistrationId); 28 sendResultToTest(pushRegistration.pushEndpoint + ' - ' + pushRegistrat ion.pushRegistrationId);
30 }, sendErrorToTest); 29 }, sendErrorToTest);
31 }, sendErrorToTest); 30 }, sendErrorToTest);
32 } 31 }
33 </script> 32 </script>
34 </head> 33 </head>
35 <body>Push API Test</body> 34 <body>Push API Test</body>
36 </html> 35 </html>
OLDNEW
« no previous file with comments | « no previous file | content/renderer/push_messaging_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698