Index: LayoutTests/fast/notifications/notifications-display-close-events.html |
diff --git a/LayoutTests/fast/notifications/notifications-display-close-events.html b/LayoutTests/fast/notifications/notifications-display-close-events.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f748a4ad02e75cada614f832b9d1a6aec3907c04 |
--- /dev/null |
+++ b/LayoutTests/fast/notifications/notifications-display-close-events.html |
@@ -0,0 +1,39 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+ <script type="text/javascript"> |
+ function log(message) |
+ { |
+ document.getElementById("result").innerHTML += message + "<br>"; |
+ } |
+ |
+ function runTests() |
+ { |
+ if (window.testRunner) { |
+ testRunner.grantWebNotificationPermission("file://"); |
+ testRunner.dumpAsText(); |
+ if (testRunner.dumpNotifications) |
+ testRunner.dumpNotifications(); |
+ testRunner.waitUntilDone(); |
+ } |
+ |
+ if (!window.webkitNotifications) { |
+ log("FAIL: No webkitNotifications interface!"); |
+ } |
+ |
+ var N = window.webkitNotifications.createNotification("", "New E-mail", "Meet me tonight at 8!"); |
+ N.ondisplay = function() { log("PASS: display event invoked."); N.cancel(); } |
+ N.onclose = function() { log("PASS: close event invoked."); testRunner.notifyDone(); } |
+ N.show(); |
+ } |
+ </script> |
+</head> |
+<body> |
+<p>Sending notifications with permission...</p> |
+<div id="result"></div> |
+ |
+<script type="text/javascript"> |
+runTests(); |
+</script> |
+</body> |
+</html> |