| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Notifications: Property reflection in the "notificationclick" event.<
/title> | 4 <title>Notifications: Property reflection in the "notificationclick" event.<
/title> |
| 5 <script src="../resources/testharness.js"></script> | 5 <script src="../resources/testharness.js"></script> |
| 6 <script src="../resources/testharnessreport.js"></script> | 6 <script src="../resources/testharnessreport.js"></script> |
| 7 <script src="../serviceworker/resources/test-helpers.js"></script> | 7 <script src="../serviceworker/resources/test-helpers.js"></script> |
| 8 <script src="resources/test-helpers.js"></script> | 8 <script src="resources/test-helpers.js"></script> |
| 9 </head> | 9 </head> |
| 10 <body> | 10 <body> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 silent: true, | 29 silent: true, |
| 30 data: [ | 30 data: [ |
| 31 { property: 'foobar', | 31 { property: 'foobar', |
| 32 string: '\uDFFF\u0000\uDBFF', | 32 string: '\uDFFF\u0000\uDBFF', |
| 33 scalar: true }, | 33 scalar: true }, |
| 34 12.15 | 34 12.15 |
| 35 ] | 35 ] |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 testRunner.setPermission('notifications', 'granted', location.origin,
location.origin); | 38 testRunner.setPermission('notifications', 'granted', location.origin,
location.origin); |
| 39 testRunner.grantWebNotificationPermission(location.origin, true); | |
| 40 getActiveServiceWorkerWithMessagePort(test, script, scope).then(functi
on(workerInfo) { | 39 getActiveServiceWorkerWithMessagePort(test, script, scope).then(functi
on(workerInfo) { |
| 41 // (1) Tell the Service Worker to display a Web Notification. | 40 // (1) Tell the Service Worker to display a Web Notification. |
| 42 workerInfo.port.postMessage({ | 41 workerInfo.port.postMessage({ |
| 43 command: 'show', | 42 command: 'show', |
| 44 | 43 |
| 45 title: scope, | 44 title: scope, |
| 46 options: options | 45 options: options |
| 47 }); | 46 }); |
| 48 | 47 |
| 49 workerInfo.port.addEventListener('message', function(event) { | 48 workerInfo.port.addEventListener('message', function(event) { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 75 assert_object_equals(event.data.notification.data, options.dat
a, 'The data field must be the same.'); | 74 assert_object_equals(event.data.notification.data, options.dat
a, 'The data field must be the same.'); |
| 76 | 75 |
| 77 test.done(); | 76 test.done(); |
| 78 }); | 77 }); |
| 79 }).catch(unreached_rejection(test)); | 78 }).catch(unreached_rejection(test)); |
| 80 | 79 |
| 81 }, 'Clicking on a notification displayed by a Service Worker the notificat
ionclick event.'); | 80 }, 'Clicking on a notification displayed by a Service Worker the notificat
ionclick event.'); |
| 82 </script> | 81 </script> |
| 83 </body> | 82 </body> |
| 84 </html> | 83 </html> |
| OLD | NEW |