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 // NO PERMISSION testRunner.grantWebNotificationPermission("file
://"); | |
14 testRunner.dumpAsText(); | |
15 } | |
16 | |
17 if (!window.webkitNotifications) { | |
18 log("FAIL: No webkitNotifications interface!"); | |
19 } | |
20 | |
21 try { | |
22 var N = window.webkitNotifications.createNotification("http://0.
0.0.0/my_icon.png", "New E-mail", "Meet me tonight at 8!"); | |
23 N.show(); | |
24 log("FAIL: Should have thrown security exception."); | |
25 } catch (e) { | |
26 log("PASS: Exception thrown."); | |
27 } | |
28 } | |
29 </script> | |
30 </head> | |
31 <body> | |
32 <p>Sending notifications without permission...</p> | |
33 <div id="result"></div> | |
34 | |
35 <script type="text/javascript"> | |
36 runTests(); | |
37 </script> | |
38 </body> | |
39 </html> | |
OLD | NEW |