summaryrefslogtreecommitdiffstats
path: root/dom/tests/mochitest/notification/desktop-notification/test_leak_windowClose.html
diff options
context:
space:
mode:
Diffstat (limited to 'dom/tests/mochitest/notification/desktop-notification/test_leak_windowClose.html')
-rw-r--r--dom/tests/mochitest/notification/desktop-notification/test_leak_windowClose.html34
1 files changed, 34 insertions, 0 deletions
diff --git a/dom/tests/mochitest/notification/desktop-notification/test_leak_windowClose.html b/dom/tests/mochitest/notification/desktop-notification/test_leak_windowClose.html
new file mode 100644
index 000000000..c0c9699ae
--- /dev/null
+++ b/dom/tests/mochitest/notification/desktop-notification/test_leak_windowClose.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=605309
+-->
+<head>
+ <title>Test for leak when window closes</title>
+ <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+ <script type="text/javascript" src="notification_common.js"></script>
+<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+
+<script>
+if (is_feature_enabled()) {
+ SimpleTest.waitForExplicitFinish();
+
+ function boom()
+ {
+ document.documentElement.focus();
+ var x = navigator.mozNotification;
+ document.documentElement.addEventListener('', function(){x}, false);
+ ok(true, "load callback called");
+ SimpleTest.finish();
+ }
+
+ window.addEventListener("load", boom, false);
+} else {
+ ok(true, "Desktop notifications not enabled.");
+}
+</script>
+</head>
+<body>
+<p> I like to write tests </p>
+</body>
+</html>