37ac369217f95fc7799d0a2a80db59ceb3675af0
[WebKit-https.git] / LayoutTests / fast / notifications / notifications-document-close-crash.html
1 <html>
2     <body>
3         <div id="result"></div>
4         <script>
5             if (window.testRunner)
6             {
7                 testRunner.dumpAsText();
8                 testRunner.setCanOpenWindows();
9                 testRunner.grantWebNotificationPermission("file://");
10                 testRunner.waitUntilDone();
11             }
12
13             if (!window.webkitNotifications) {
14                 log("FAIL: No webkitNotifications interface!");
15             }
16
17             var target = window.open("about:blank");
18             var notification = target.webkitNotifications;
19             target.location.reload();
20             var timer = setInterval("crash()", 60);
21             setTimeout("finish()", 100);
22
23             function crash()
24             {
25                 var a = [];
26                 for (var i = 0; i < 0x100; i++)
27                 {
28                     try
29                     {
30                         a.push(new WebGLByteArray());
31                     }
32                     catch (e) {}
33                     a.push(Array(i).join("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"));
34                 }
35                 delete a;
36                 notification.requestPermission();
37             }
38
39             function finish()
40             {
41                 clearInterval(timer);
42                 document.getElementById("result").innerHTML = "PASS";
43                 target.close();
44                 if (window.testRunner)
45                     testRunner.notifyDone();
46             }
47         </script>
48     </body>
49 </html>
50