| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script type="text/javascript"> | 4 <script type="text/javascript"> |
| 5 function log(message) | 5 function log(message) |
| 6 { | 6 { |
| 7 document.getElementById("result").innerHTML += message + "<br>"; | 7 document.getElementById("result").innerHTML += message + "<br>"; |
| 8 } | 8 } |
| 9 | 9 |
| 10 function runTests() | 10 function runTests() |
| 11 { | 11 { |
| 12 if (window.testRunner) { | 12 if (window.testRunner) { |
| 13 testRunner.grantWebNotificationPermission("file://"); | 13 testRunner.grantWebNotificationPermission("file://", true); |
| 14 testRunner.dumpAsText(); | 14 testRunner.dumpAsText(); |
| 15 testRunner.waitUntilDone(); | 15 testRunner.waitUntilDone(); |
| 16 } | 16 } |
| 17 | 17 |
| 18 if (!window.Notification) { | 18 if (!window.Notification) { |
| 19 log("FAIL: No Notification constructor!"); | 19 log("FAIL: No Notification constructor!"); |
| 20 } | 20 } |
| 21 | 21 |
| 22 var N = new Notification("Hello world"); | 22 var N = new Notification("Hello world"); |
| 23 N.onshow = function() { log("PASS: show event fired."); } | 23 N.onshow = function() { log("PASS: show event fired."); } |
| 24 N.onerror = function() { log("FAIL: error event fired."); } | 24 N.onerror = function() { log("FAIL: error event fired."); } |
| 25 setTimeout(function() { testRunner.notifyDone(); }, 100); | 25 setTimeout(function() { testRunner.notifyDone(); }, 100); |
| 26 } | 26 } |
| 27 </script> | 27 </script> |
| 28 </head> | 28 </head> |
| 29 <body> | 29 <body> |
| 30 <p>Sending notifications with permission...</p> | 30 <p>Sending notifications with permission...</p> |
| 31 <div id="result"></div> | 31 <div id="result"></div> |
| 32 | 32 |
| 33 <script type="text/javascript"> | 33 <script type="text/javascript"> |
| 34 runTests(); | 34 runTests(); |
| 35 </script> | 35 </script> |
| 36 </body> | 36 </body> |
| 37 </html> | 37 </html> |
| OLD | NEW |