| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 body: 'Contents', | 54 body: 'Contents', |
| 55 tag: 'replace-id', | 55 tag: 'replace-id', |
| 56 icon: 'icon.png', | 56 icon: 'icon.png', |
| 57 silent: true, | 57 silent: true, |
| 58 data: [ | 58 data: [ |
| 59 { property: 'value' } | 59 { property: 'value' } |
| 60 ] | 60 ] |
| 61 }); | 61 }); |
| 62 } | 62 } |
| 63 | 63 |
| 64 // Displays a persistent notification with vibrate field. |
| 65 function DisplayPersistentNotificationVibrate() { |
| 66 DisplayPersistentNotification('Title', { |
| 67 body: 'Contents', |
| 68 vibrate: [100, 200, 300] |
| 69 }); |
| 70 } |
| 71 |
| 64 // Displays a persistent notification with a data: URL as its image. | 72 // Displays a persistent notification with a data: URL as its image. |
| 65 function DisplayPersistentNotificationDataUrlImage() { | 73 function DisplayPersistentNotificationDataUrlImage() { |
| 66 fetch('icon.png').then(function(response) { | 74 fetch('icon.png').then(function(response) { |
| 67 return response.blob(); | 75 return response.blob(); |
| 68 }).then(function(blob) { | 76 }).then(function(blob) { |
| 69 var reader = new FileReader(); | 77 var reader = new FileReader(); |
| 70 reader.readAsDataURL(blob); | 78 reader.readAsDataURL(blob); |
| 71 reader.onloadend = function() { | 79 reader.onloadend = function() { |
| 72 DisplayPersistentNotification('Data URL Title', { | 80 DisplayPersistentNotification('Data URL Title', { |
| 73 body: 'Contents', | 81 body: 'Contents', |
| (...skipping 24 matching lines...) Expand all Loading... |
| 98 if (!messageStack.length) { | 106 if (!messageStack.length) { |
| 99 expectingMessage = true; | 107 expectingMessage = true; |
| 100 return; | 108 return; |
| 101 } | 109 } |
| 102 | 110 |
| 103 domAutomationController.send('' + messageStack.pop()); | 111 domAutomationController.send('' + messageStack.pop()); |
| 104 } | 112 } |
| 105 </script> | 113 </script> |
| 106 </body> | 114 </body> |
| 107 </html> | 115 </html> |
| OLD | NEW |