Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: LayoutTests/fast/notifications/notification-replace.html

Issue 186713002: Add new layout tests for the Web Notification API. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698