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.ondisplay = function() { log("PASS: display event invoked."); N.ca
ncel(); } | |
26 N.onclose = function() { log("PASS: close event invoked."); testRunn
er.notifyDone(); } | |
27 N.show(); | |
28 } | |
29 </script> | |
30 </head> | |
31 <body> | |
32 <p>Sending notifications with permission...</p> | |
33 <div id="result"></div> | |
34 | |
35 <script type="text/javascript"> | |
36 runTests(); | |
37 </script> | |
38 </body> | |
39 </html> | |
OLD | NEW |