summaryrefslogtreecommitdiffstats
path: root/dom/tests/mochitest/notification/desktop-notification/test_leak_windowClose.html
blob: c0c9699ae176f22f7bb88e41d3442347d4a65c7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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>