| 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 17 matching lines...) Expand all Loading... |
| 28 icon: 'https://example/icon.png', | 28 icon: 'https://example/icon.png', |
| 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.grantWebNotificationPermission(location.origin, true); | 39 testRunner.grantWebNotificationPermission(location.origin, true); |
| 39 getActiveServiceWorkerWithMessagePort(test, script, scope).then(functi
on(workerInfo) { | 40 getActiveServiceWorkerWithMessagePort(test, script, scope).then(functi
on(workerInfo) { |
| 40 // (1) Tell the Service Worker to display a Web Notification. | 41 // (1) Tell the Service Worker to display a Web Notification. |
| 41 workerInfo.port.postMessage({ | 42 workerInfo.port.postMessage({ |
| 42 command: 'show', | 43 command: 'show', |
| 43 | 44 |
| 44 title: scope, | 45 title: scope, |
| 45 options: options | 46 options: options |
| 46 }); | 47 }); |
| 47 | 48 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 73 | 74 |
| 74 assert_object_equals(event.data.notification.data, options.dat
a, 'The data field must be the same.'); | 75 assert_object_equals(event.data.notification.data, options.dat
a, 'The data field must be the same.'); |
| 75 | 76 |
| 76 test.done(); | 77 test.done(); |
| 77 }); | 78 }); |
| 78 }).catch(unreached_rejection(test)); | 79 }).catch(unreached_rejection(test)); |
| 79 | 80 |
| 80 }, 'Clicking on a notification displayed by a Service Worker the notificat
ionclick event.'); | 81 }, 'Clicking on a notification displayed by a Service Worker the notificat
ionclick event.'); |
| 81 </script> | 82 </script> |
| 82 </body> | 83 </body> |
| 83 </html> | 84 </html> |
| OLD | NEW |