Crash when trying to invalidate the NPRuntimeObjectMap for a plug-in in a subframe
[WebKit-https.git] / LayoutTests / plugins / update-widgets-crash.html
1 <!DOCTYPE html>
2
3 <html>
4 <head>
5     <style type="text/css" media="screen">
6         embed {
7             position: relative;
8             width: 100px;
9             height: 100px;
10         }
11     </style>
12     <script type="text/javascript" charset="utf-8">
13     if (window.layoutTestController) {
14         layoutTestController.dumpAsText();
15         layoutTestController.waitUntilDone();
16     }
17
18     // This gets called automatically from the test plugin.
19     var doingTest = false;
20     function setWindowCalled()
21     {
22         if (!doingTest)
23             return;
24
25         var victim = document.getElementById('victim');
26         victim.parentNode.removeChild(victim);
27         document.body.offsetTop;
28
29         if (window.layoutTestController)
30             layoutTestController.notifyDone();
31         doingTest = false;
32     }
33     
34     function doTest()
35     {
36         doingTest = true;
37         document.getElementById('plugin').style.top = "120px";
38         document.body.offsetTop;
39         doingTest = false;
40     }
41     
42     window.addEventListener('load', doTest, false);
43     </script>
44 </head>
45 <body>
46
47     <p>This test should not crash.</p>
48     <embed type="application/x-webkit-test-netscape"
49         onSetWindow="setWindowCalled()"
50         id="plugin">
51     <embed name="victim" type="application/x-webkit-test-netscape" id="victim">
52   
53 </body>
54 </html>