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.dumpAsText(); | |
14 } | |
15 | |
16 if (!window.webkitNotifications) { | |
17 log("FAIL: No webkitNotifications interface!"); | |
18 } | |
19 | |
20 var N = window.webkitNotifications.checkPermission(); | |
21 if (N != 0) { | |
22 log("PASS: Permission not granted."); | |
23 } else { | |
24 log("FAIL: Permission shouldn't be granted."); | |
25 } | |
26 | |
27 if (window.testRunner) { | |
28 testRunner.grantWebNotificationPermission("file://"); | |
29 } | |
30 | |
31 N = window.webkitNotifications.checkPermission(); | |
32 if (N == 0) { | |
33 log("PASS: Permission granted."); | |
34 } else { | |
35 log("FAIL: Permission not granted."); | |
36 } | |
37 } | |
38 </script> | |
39 </head> | |
40 <body> | |
41 <p>Checking permission...</p> | |
42 <div id="result"></div> | |
43 <script type="text/javascript"> | |
44 runTests(); | |
45 </script> | |
46 | |
47 </body> | |
48 </html> | |
OLD | NEW |