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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 return; | 64 return; |
65 } | 65 } |
66 | 66 |
67 // (3) Listen for confirmation from the Service Worker that th
e | 67 // (3) Listen for confirmation from the Service Worker that th
e |
68 // notification has been clicked on. Make sure that all proper
ties | 68 // notification has been clicked on. Make sure that all proper
ties |
69 // set on the Notification object are as expected. | 69 // set on the Notification object are as expected. |
70 assert_equals(event.data.command, 'click', 'The notification w
as expected to be clicked.'); | 70 assert_equals(event.data.command, 'click', 'The notification w
as expected to be clicked.'); |
71 | 71 |
72 options.actions = options.actions.slice(0, Notification.maxAct
ions); | 72 options.actions = options.actions.slice(0, Notification.maxAct
ions); |
73 Object.keys(options).forEach(function(key) { | 73 Object.keys(options).forEach(function(key) { |
74 if (key == 'requireInteraction') { | |
75 // TODO(johnme): requireInteraction is not yet seriali
zed properly. | |
76 return; | |
77 } | |
78 if (typeof options[key] == 'object') | 74 if (typeof options[key] == 'object') |
79 assert_object_equals(event.data.notification[key], opt
ions[key], 'The ' + key + ' field must be the same.'); | 75 assert_object_equals(event.data.notification[key], opt
ions[key], 'The ' + key + ' field must be the same.'); |
80 else | 76 else |
81 assert_equals(event.data.notification[key], options[ke
y], 'The ' + key + ' field must be the same.'); | 77 assert_equals(event.data.notification[key], options[ke
y], 'The ' + key + ' field must be the same.'); |
82 }); | 78 }); |
83 | 79 |
84 test.done(); | 80 test.done(); |
85 }); | 81 }); |
86 }).catch(unreached_rejection(test)); | 82 }).catch(unreached_rejection(test)); |
87 | 83 |
88 }, 'Clicking on a notification displayed by a Service Worker the notificat
ionclick event.'); | 84 }, 'Clicking on a notification displayed by a Service Worker the notificat
ionclick event.'); |
89 </script> | 85 </script> |
90 </body> | 86 </body> |
91 </html> | 87 </html> |
OLD | NEW |