| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../../resources/js-test.js"></script> |
| 5 </head> |
| 6 <body> |
| 7 <p> |
| 8 Tests that it is possible to replace existing notifications using the "tag
" property of |
| 9 a Web Notification object. When running this test manually, verify that th
e title of the |
| 10 shown notification is updated to read "Notification 2". |
| 11 </p> |
| 12 <div id="console"></div> |
| 13 <script> |
| 14 if (window.testRunner) { |
| 15 testRunner.grantWebNotificationPermission("file://", true); |
| 16 testRunner.waitUntilDone(); |
| 17 } |
| 18 |
| 19 var notification = new Notification("Notification", { |
| 20 tag: "my-notification" |
| 21 }); |
| 22 |
| 23 notification.addEventListener("show", function() { |
| 24 testPassed("notification.onshow() has been called."); |
| 25 |
| 26 var updatedNotification = new Notification("Notification 2", { |
| 27 tag: "my-notification" |
| 28 }); |
| 29 |
| 30 updatedNotification.addEventListener("show", function() { |
| 31 testPassed("updatedNotification.onshow() has been called."); |
| 32 if (window.testRunner) |
| 33 testRunner.notifyDone(); |
| 34 }); |
| 35 }); |
| 36 </script> |
| 37 </body> |
| 38 </body> |
| OLD | NEW |