blob: b5f0cee7b323c37cc781e9e78d73781a50fc844a [file] [log] [blame]
ggaren2663f9a2007-03-29 23:26:30 +00001<head>
mark.lam@apple.com44b41662013-09-08 04:22:45 +00002<script src="../resources/js-test-pre.js"></script>
ggaren2663f9a2007-03-29 23:26:30 +00003</head>
4<body>
ggaren2663f9a2007-03-29 23:26:30 +00005<script>
andersca1beb0d92007-03-30 21:41:00 +00006function main()
7{
rniwa@webkit.org5cf7fa82012-06-15 07:38:37 +00008 if (!window.testRunner) {
andersca1beb0d92007-03-30 21:41:00 +00009 debug("This test can only run from within DumpRenderTree because it requires TestNetscapePlugin.\n");
10 return;
11 }
12
rniwa@webkit.org5cf7fa82012-06-15 07:38:37 +000013 testRunner.waitUntilDone();
andersca1beb0d92007-03-30 21:41:00 +000014}
15main();
ggaren2663f9a2007-03-29 23:26:30 +000016
17function 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
andersca@apple.com3125b1b2009-03-04 01:10:12 +000025 shouldBe("document.getElementById('plugin').destroyNullStream()", "2"); // Now try destroying a null stream
26
ggaren2663f9a2007-03-29 23:26:30 +000027 debug("PASS: You didn't crash.\n");
28
arv@chromium.org1d5aa052011-11-04 02:16:03 +000029 isSuccessfullyParsed();
rniwa@webkit.org5cf7fa82012-06-15 07:38:37 +000030 testRunner.notifyDone();
ggaren2663f9a2007-03-29 23:26:30 +000031}
andersca1beb0d92007-03-30 21:41:00 +000032</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>
ggaren2663f9a2007-03-29 23:26:30 +000039
andersca1beb0d92007-03-30 21:41:00 +000040<script>
41description("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");
ggaren2663f9a2007-03-29 23:26:30 +000042
ggaren2663f9a2007-03-29 23:26:30 +000043
ggaren2663f9a2007-03-29 23:26:30 +000044</script>