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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
62 testRunner.simulateWebNotificationClick(scope); | 62 testRunner.simulateWebNotificationClick(scope); |
63 return; | 63 return; |
64 } | 64 } |
65 | 65 |
66 // (3) Listen for confirmation from the Service Worker that th e | 66 // (3) Listen for confirmation from the Service Worker that th e |
67 // notification has been clicked on. Make sure that all proper ties | 67 // notification has been clicked on. Make sure that all proper ties |
68 // set on the Notification object are as expected. | 68 // set on the Notification object are as expected. |
69 assert_equals(event.data.command, 'click', 'The notification w as expected to be clicked.'); | 69 assert_equals(event.data.command, 'click', 'The notification w as expected to be clicked.'); |
70 | 70 |
71 Object.keys(options).forEach(function(key) { | 71 Object.keys(options).forEach(function(key) { |
72 if (key == 'actions') { | 72 if (key == "actions") |
Peter Beverloo
2015/08/04 21:01:23
Single quotes. (Consistency with the file.)
johnme
2015/08/05 11:56:22
Done.
| |
73 // TODO(johnme): actions are not yet serialized proper ly. | 73 assert_object_equals(event.data.notification.actions, options.actions.slice(0, Notification.maxActions)); |
74 return; | 74 else |
75 } | 75 assert_object_equals(event.data.notification[key], opt ions[key], 'The ' + key + ' field must be the same.'); |
76 assert_object_equals(event.data.notification[key], options [key], 'The ' + key + ' field must be the same.'); | |
77 }); | 76 }); |
78 | 77 |
79 test.done(); | 78 test.done(); |
80 }); | 79 }); |
81 }).catch(unreached_rejection(test)); | 80 }).catch(unreached_rejection(test)); |
82 | 81 |
83 }, 'Clicking on a notification displayed by a Service Worker the notificat ionclick event.'); | 82 }, 'Clicking on a notification displayed by a Service Worker the notificat ionclick event.'); |
84 </script> | 83 </script> |
85 </body> | 84 </body> |
86 </html> | 85 </html> |
OLD | NEW |