Chromium Code Reviews| Index: LayoutTests/fast/notifications/notification-replace.html |
| diff --git a/LayoutTests/fast/notifications/notification-replace.html b/LayoutTests/fast/notifications/notification-replace.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..adcb269bb91b33dbd0228f9580a0a8b021110aff |
| --- /dev/null |
| +++ b/LayoutTests/fast/notifications/notification-replace.html |
| @@ -0,0 +1,38 @@ |
| +<!DOCTYPE html> |
| +<html> |
| + <head> |
| + <script src="../../resources/js-test.js"></script> |
| + </head> |
| + <body> |
| + <p> |
| + Tests that it is possible to replace existing notifications using the "tag" property of |
| + a Web Notification object. When running this test manually, verify that the title of the |
| + shown notification is updated to read "Notification 2". |
| + </p> |
| + <div id="console"></div> |
| + <script> |
| + if (window.testRunner) { |
| + testRunner.grantWebNotificationPermission("file://", true); |
| + testRunner.waitUntilDone(); |
| + } |
| + |
| + var notification = new Notification("Notification", { |
| + tag: "my-notification" |
| + }); |
| + |
| + notification.addEventListener("show", function() { |
| + testPassed("notification.onshow() has been called."); |
| + |
| + var updatedNotification = new Notification("Notification 2", { |
| + tag: "my-notification" |
| + }); |
| + |
| + updatedNotification.addEventListener("show", function() { |
| + testPassed("updatedNotification.onshow() has been called."); |
|
Andrew T Wilson (Slow)
2014/03/04 21:26:38
Does this test actually ensure that the first noti
|
| + if (window.testRunner) |
| + testRunner.notifyDone(); |
| + }); |
| + }); |
| + </script> |
| + </body> |
| +</body> |