| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <title>Push API: hasPermission resolves with granted when permission is granted<
/title> | |
| 5 <link rel="manifest" href="resources/push_manifest.json"> | |
| 6 <script src="../resources/testharness.js"></script> | |
| 7 <script src="../resources/testharnessreport.js"></script> | |
| 8 <script src="../serviceworker/resources/test-helpers.js"></script> | |
| 9 </head> | |
| 10 <body> | |
| 11 <script> | |
| 12 async_test(function(test) { | |
| 13 var workerUrl = 'resources/empty_worker.js'; | |
| 14 var workerScope = 'resources/scope/' + location.pathname; | |
| 15 service_worker_unregister_and_register(test, workerUrl, workerScope) | |
| 16 .then(function(serviceWorkerRegistration) { | |
| 17 // If running manually, grant permission when prompted. | |
| 18 if (window.testRunner) | |
| 19 testRunner.setPermission('push-messaging', 'granted', location.o
rigin, location.origin); | |
| 20 return serviceWorkerRegistration.pushManager.hasPermission(); | |
| 21 }) | |
| 22 .then(function(permissionStatus) { | |
| 23 assert_equals(permissionStatus, 'granted'); | |
| 24 return service_worker_unregister_and_done(test, workerScope); | |
| 25 }) | |
| 26 .catch(unreached_rejection(test)); | |
| 27 }, 'Push API: hasPermission resolves with granted when permission is granted'); | |
| 28 </script> | |
| 29 </body> | |
| 30 </html> | |
| OLD | NEW |