| 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 a
nd SWR.getNotifications().</title> | 4 <title>Notifications: Property reflection in the "notificationclick" event a
nd SWR.getNotifications().</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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 workerInfo.port.addEventListener('message', function(event) { | 72 workerInfo.port.addEventListener('message', function(event) { |
| 73 if (typeof event.data != 'object' || !event.data.command) { | 73 if (typeof event.data != 'object' || !event.data.command) { |
| 74 assert_unreached('Invalid message from the Service Worker.
'); | 74 assert_unreached('Invalid message from the Service Worker.
'); |
| 75 return; | 75 return; |
| 76 } | 76 } |
| 77 | 77 |
| 78 // (2) Listen for confirmation from the Service Worker that th
e | 78 // (2) Listen for confirmation from the Service Worker that th
e |
| 79 // notification's display promise has been resolved. | 79 // notification's display promise has been resolved. |
| 80 if (event.data.command == 'show') { | 80 if (event.data.command == 'show') { |
| 81 assert_true(event.data.success, 'The notification must hav
e been displayed.'); | 81 assert_true(event.data.success, 'The notification must hav
e been displayed.'); |
| 82 testRunner.simulateWebNotificationClick(scope); | 82 testRunner.simulateWebNotificationClick(scope, -1 /* actio
n_index */); |
| 83 return; | 83 return; |
| 84 } | 84 } |
| 85 | 85 |
| 86 // (3) Listen for confirmation from the Service Worker that th
e | 86 // (3) Listen for confirmation from the Service Worker that th
e |
| 87 // notification has been clicked on. Make sure that all proper
ties | 87 // notification has been clicked on. Make sure that all proper
ties |
| 88 // set on the cloned Notification object are as expected. | 88 // set on the cloned Notification object are as expected. |
| 89 assert_equals(event.data.command, 'click', 'The notification w
as expected to be clicked.'); | 89 assert_equals(event.data.command, 'click', 'The notification w
as expected to be clicked.'); |
| 90 assert_object_is_superset(event.data.notification, options, 'T
he Notification object properties must be the same in notificationclick events.'
); | 90 assert_object_is_superset(event.data.notification, options, 'T
he Notification object properties must be the same in notificationclick events.'
); |
| 91 | 91 |
| 92 // (4) Check that the properties are also set correctly on the | 92 // (4) Check that the properties are also set correctly on the |
| (...skipping 15 matching lines...) Expand all Loading... |
| 108 | 108 |
| 109 test.done(); | 109 test.done(); |
| 110 }); | 110 }); |
| 111 }); | 111 }); |
| 112 }).catch(unreached_rejection(test)); | 112 }).catch(unreached_rejection(test)); |
| 113 | 113 |
| 114 }, 'Clicking on a notification displayed by a Service Worker the notificat
ionclick event.'); | 114 }, 'Clicking on a notification displayed by a Service Worker the notificat
ionclick event.'); |
| 115 </script> | 115 </script> |
| 116 </body> | 116 </body> |
| 117 </html> | 117 </html> |
| OLD | NEW |