Chromium Code Reviews| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 { property: 'foobar', | 47 { property: 'foobar', |
| 48 string: '\uDFFF\u0000\uDBFF', | 48 string: '\uDFFF\u0000\uDBFF', |
| 49 scalar: true }, | 49 scalar: true }, |
| 50 12.15 | 50 12.15 |
| 51 ], | 51 ], |
| 52 actions: [] | 52 actions: [] |
| 53 }; | 53 }; |
| 54 // Deliberately add more actions than are supported. | 54 // Deliberately add more actions than are supported. |
| 55 for (var i = 0; i < 2 * Notification.maxActions; i++) { | 55 for (var i = 0; i < 2 * Notification.maxActions; i++) { |
| 56 options.actions.push({ | 56 options.actions.push({ |
| 57 type: i % 2 == 0 ? 'button' : 'text', | |
|
Mike West
2016/04/05 14:41:00
Can you add some tests for invalid values?
Nina
2016/04/05 16:10:01
This is taken care of automatically by the IDL gen
| |
| 57 action: 'a' + i, | 58 action: 'a' + i, |
| 58 title: 'Action ' + i, | 59 title: 'Action ' + i, |
| 59 icon: 'https://example/action_icon_' + i + '.png' | 60 icon: 'https://example/action_icon_' + i + '.png', |
| 61 placeholder: i % 2 == 0 ? null : 'Type a reply...' | |
| 60 }); | 62 }); |
| 61 } | 63 } |
| 62 | 64 |
| 63 if (window.testRunner) { | 65 if (window.testRunner) { |
| 64 testRunner.setPermission('notifications', 'granted', location.orig in, location.origin); | 66 testRunner.setPermission('notifications', 'granted', location.orig in, location.origin); |
| 65 } | 67 } |
| 66 getActiveServiceWorkerWithMessagePort(test, script, scope).then(functi on(workerInfo) { | 68 getActiveServiceWorkerWithMessagePort(test, script, scope).then(functi on(workerInfo) { |
| 67 // (1) Tell the Service Worker to display a Web Notification. | 69 // (1) Tell the Service Worker to display a Web Notification. |
| 68 workerInfo.port.postMessage({ | 70 workerInfo.port.postMessage({ |
| 69 command: 'show', | 71 command: 'show', |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 116 | 118 |
| 117 test.done(); | 119 test.done(); |
| 118 }); | 120 }); |
| 119 }); | 121 }); |
| 120 }).catch(unreached_rejection(test)); | 122 }).catch(unreached_rejection(test)); |
| 121 | 123 |
| 122 }, 'Clicking on a notification displayed by a Service Worker the notificat ionclick event.'); | 124 }, 'Clicking on a notification displayed by a Service Worker the notificat ionclick event.'); |
| 123 </script> | 125 </script> |
| 124 </body> | 126 </body> |
| 125 </html> | 127 </html> |
| OLD | NEW |