Source/WebCore: [V8] Crash in npObjectGetProperty() in V8NPObject.cpp
[WebKit-https.git] / LayoutTests / plugins / netscape-dom-access-and-reload.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script>
5 function runTest()
6 {
7     // Make the plugin retrieve a DOM element to itself. This exercises
8     // https://bugs.webkit.org/show_bug.cgi?id=80428
9     document.getElementById("testPlugin").testDOMAccess();
10
11     var callReload = true;
12     if (window.sessionStorage) {
13         if (window.sessionStorage.netscapeDomAccessAndReloadHasReloaded)
14             callReload = false;
15         else
16             window.sessionStorage.netscapeDomAccessAndReloadHasReloaded = 1;
17     }
18
19     if (window.layoutTestController)
20         layoutTestController.dumpAsText();
21     
22     if (callReload) {
23         if (window.layoutTestController)
24             layoutTestController.waitUntilDone();
25         location.reload();
26     } else {
27         window.GCController.collect();
28         // Note we could also collect the number of live nodes, but that seems
29         // more likely to give spurious failures. When an HTMLPluginElement is
30         // improperly retained, its owning Document also survives, so we'll
31         // detect an excess Document.
32         if (internals && internals.numberOfLiveDocuments) {
33             var numberOfLiveDocuments = internals.numberOfLiveDocuments();
34             if (numberOfLiveDocuments == 1) {
35                 document.getElementById("result").innerHTML = "SUCCESS";
36             }
37         } else {
38               document.getElementById("result").innerHTML = "FAILED; This test is only valid in DumpRenderTree, and only when the Inspector is enabled.";
39         }
40         if (window.layoutTestController) {
41             layoutTestController.dumpAsText();
42             layoutTestController.notifyDone();
43         }
44     }
45 }
46 </script>
47 </head>
48 <body onload="runTest();">
49 <p>This page tests reloading a Netscape plug-in that accesses its own DOM element. See https://bugs.webkit.org/show_bug.cgi?id=80428, "HTMLPluginElement is not destroyed on reload or navigation if getNPObject is called".
50
51 If it succeeds, you should see SUCCESS below.
52 <embed id="testPlugin" type="application/x-webkit-test-netscape" width="200" height="200"></embed>
53 <div id="result">FAILURE</div>
54 </body>
55 </html>