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

Unified Diff: LayoutTests/fast/notifications/notification-click.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/notifications/notification-click-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/notifications/notification-click.html
diff --git a/LayoutTests/fast/notifications/notification-click.html b/LayoutTests/fast/notifications/notification-click.html
new file mode 100644
index 0000000000000000000000000000000000000000..683b47131c04f93225f23f3e4136861fb8f01430
--- /dev/null
+++ b/LayoutTests/fast/notifications/notification-click.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <script src="../../resources/js-test.js"></script>
+ </head>
+ <body>
+ <p>
+ Tests that Notification.click() will result in the onclick event being called. When
+ running this test manually, accept the permission and click on the shown notification.
+ </p>
+ <div id="console"></div>
+ <script>
+ if (window.testRunner) {
+ testRunner.grantWebNotificationPermission("file://", true);
+ testRunner.waitUntilDone();
+ }
+
+ var notification = new Notification("Notification");
+ notification.addEventListener("show", function() {
+ testPassed("notification.onshow() has been called.");
+ if (window.testRunner)
+ testRunner.simulateWebNotificationClick("Notification");
+ });
+
+ notification.addEventListener("click", function() {
+ testPassed("notification.onclick() has been called.");
+ notification.close();
+
+ if (window.testRunner)
+ testRunner.notifyDone();
+ });
+ </script>
+ </body>
+</body>
« no previous file with comments | « no previous file | LayoutTests/fast/notifications/notification-click-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698