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 } |
| 16 |
| 17 if (!window.webkitNotifications) { |
| 18 log("FAIL: No webkitNotifications interface!"); |
| 19 } |
| 20 |
| 21 var N = window.webkitNotifications.createNotification("http://localh
ost/my_icon.png", "New E-mail", "Meet me tonight at 8!"); |
| 22 N.addEventListener("close", function() { log("PASS: addEventListener
(close) callback #1 invoked"); }); |
| 23 N.onclose = function() { log("PASS: onclose attribut
e event callback invoked."); } |
| 24 N.addEventListener("close", function() { log("PASS: addEventListener
(close) capture callback #1 invoked"); }, true ); |
| 25 N.addEventListener("close", function() { log("PASS: addEventListener
(close) capture callback #2 invoked"); }, true ); |
| 26 N.addEventListener("close", function() { log("PASS: addEventListener
(close) callback #3 invoked"); }); |
| 27 N.show(); |
| 28 N.cancel(); |
| 29 } |
| 30 </script> |
| 31 </head> |
| 32 <body> |
| 33 <p>Sending notifications with permission...</p> |
| 34 <div id="result"></div> |
| 35 |
| 36 <script type="text/javascript"> |
| 37 runTests(); |
| 38 </script> |
| 39 </body> |
| 40 </html> |
OLD | NEW |