Source/WebCore: [V8] Crash in npObjectGetProperty() in V8NPObject.cpp
[WebKit-https.git] / LayoutTests / plugins / destroy-stream-twice.html
1 <head>
2 <script src="../fast/js/resources/js-test-pre.js"></script>
3 </head>
4 <body>
5 <script>
6 function main() 
7 {
8     if (!window.layoutTestController) {
9         debug("This test can only run from within DumpRenderTree because it requires TestNetscapePlugin.\n");
10         return;
11     }
12
13     layoutTestController.waitUntilDone();
14 }
15 main();
16
17 function runTest()
18 {
19     debug("destroyStream() returns zero to indicate success, or a non-zero error code to indicate failure");
20
21     shouldBe("document.getElementById('plugin').hasStream", "true");
22     shouldBe("document.getElementById('plugin').destroyStream()", "2"); // we expect to fail because the stream should already have completed loading and destroyed itself
23     shouldBe("document.getElementById('plugin').destroyStream()", "2"); // try again, just for good measure
24
25     shouldBe("document.getElementById('plugin').destroyNullStream()", "2"); // Now try destroying a null stream
26
27     debug("PASS: You didn't crash.\n");
28
29     isSuccessfullyParsed();
30     layoutTestController.notifyDone();
31 }
32 </script>
33 <embed id="plugin" 
34        type="application/x-webkit-test-netscape"
35        src="data:text/plain,"
36        style="width:0; height:0"
37        onstreamload="setTimeout(runTest, 0);">
38 </embed>
39
40 <script>
41 description("Test for http://bugs.webkit.org/show_bug.cgi?id=13203: REGRESSION: Repro crash in -[WebBaseNetscapePluginView(WebNPPCallbacks) destroyStream:reason:] navigating away from page with DivX movie plug-in");
42
43
44 </script>