| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <html lang="en"> | 2 <html lang="en"> |
| 3 <head> | 3 <head> |
| 4 <meta charset="utf-8"> | 4 <meta charset="utf-8"> |
| 5 <title>Platform Notification Service BrowserTest service page</title> | 5 <title>Platform Notification Service BrowserTest service page</title> |
| 6 </head> | 6 </head> |
| 7 <body> | 7 <body> |
| 8 <!-- This page is intended to be used by the cross-platform | 8 <!-- This page is intended to be used by the cross-platform |
| 9 PlatformNotificationServiceBrowserTest. --> | 9 PlatformNotificationServiceBrowserTest. --> |
| 10 <script src="notification_test_utils.js"></script> | 10 <script src="notification_test_utils.js"></script> |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 function DisplayPersistentNotificationWithActionButtons() { | 109 function DisplayPersistentNotificationWithActionButtons() { |
| 110 DisplayPersistentNotification('action_button_click', { | 110 DisplayPersistentNotification('action_button_click', { |
| 111 body: 'Contents', | 111 body: 'Contents', |
| 112 actions: [ | 112 actions: [ |
| 113 { action: 'actionId1', title: 'actionTitle1', icon: 'icon.png' }, | 113 { action: 'actionId1', title: 'actionTitle1', icon: 'icon.png' }, |
| 114 { action: 'actionId2', title: 'actionTitle2', icon: 'icon.png' } | 114 { action: 'actionId2', title: 'actionTitle2', icon: 'icon.png' } |
| 115 ] | 115 ] |
| 116 }); | 116 }); |
| 117 } | 117 } |
| 118 | 118 |
| 119 // Displays a persistent notification with a reply button. |
| 120 function DisplayPersistentNotificationWithReplyButton() { |
| 121 DisplayPersistentNotification('action_button_click', { |
| 122 body: 'Contents', |
| 123 actions: [ |
| 124 { action: 'actionId1', title: 'actionTitle1', icon: 'icon.png', |
| 125 type: 'text' } |
| 126 ] |
| 127 }); |
| 128 } |
| 129 |
| 119 // Returns the latest received message from the worker. If no message has | 130 // Returns the latest received message from the worker. If no message has |
| 120 // been received, nothing will be done. For successfully registered | 131 // been received, nothing will be done. For successfully registered |
| 121 // Service Workers this is OK, however, since the "message" event handler | 132 // Service Workers this is OK, however, since the "message" event handler |
| 122 // in DisplayPersistentNotification will take care of notifying the DOM | 133 // in DisplayPersistentNotification will take care of notifying the DOM |
| 123 // Automation Controller instead. | 134 // Automation Controller instead. |
| 124 function GetMessageFromWorker() { | 135 function GetMessageFromWorker() { |
| 125 if (!messageStack.length) { | 136 if (!messageStack.length) { |
| 126 expectingMessage = true; | 137 expectingMessage = true; |
| 127 return; | 138 return; |
| 128 } | 139 } |
| 129 | 140 |
| 130 domAutomationController.send('' + messageStack.pop()); | 141 domAutomationController.send('' + messageStack.pop()); |
| 131 } | 142 } |
| 132 </script> | 143 </script> |
| 133 </body> | 144 </body> |
| 134 </html> | 145 </html> |
| OLD | NEW |