OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script type="text/javascript"> |
| 5 function log(message) |
| 6 { |
| 7 document.getElementById("result").innerHTML += message + "<br>"; |
| 8 } |
| 9 |
| 10 function runTests() |
| 11 { |
| 12 if (window.testRunner) { |
| 13 testRunner.grantWebNotificationPermission("file://"); |
| 14 testRunner.dumpAsText(); |
| 15 if (testRunner.dumpNotifications) |
| 16 testRunner.dumpNotifications(); |
| 17 testRunner.waitUntilDone(); |
| 18 } |
| 19 |
| 20 if (!window.webkitNotifications) { |
| 21 log("FAIL: No webkitNotifications interface!"); |
| 22 } |
| 23 |
| 24 var N = window.webkitNotifications.createNotification("", "New E-mai
l", "Meet me tonight at 8!"); |
| 25 N.onclick = function() { log("PASS: click event fired."); N.cancel()
; } |
| 26 N.show(); |
| 27 if (window.testRunner) { |
| 28 testRunner.simulateLegacyWebNotificationClick("New E-mail"); |
| 29 testRunner.notifyDone(); |
| 30 } |
| 31 } |
| 32 </script> |
| 33 </head> |
| 34 <body> |
| 35 <p>Showing notifications.</p> |
| 36 |
| 37 <p>To exercise manually, grant notification permissions and load this page, then
click on the notification. You should see a "PASS" message.</p> |
| 38 <div id="result"></div> |
| 39 |
| 40 <script type="text/javascript"> |
| 41 runTests(); |
| 42 </script> |
| 43 </body> |
| 44 </html> |
OLD | NEW |