summaryrefslogtreecommitdiffstats
path: root/chrome/test/data/npapi
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-11 21:01:17 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-11 21:01:17 +0000
commit91332b626ed0625764b76ec108f5de24ea7c22ed (patch)
tree5d6d40632c7b4de720ae3dd96431caf27d17aba5 /chrome/test/data/npapi
parent02473008f5f1948494b9fb69e5781746b66f6f80 (diff)
downloadchromium_src-91332b626ed0625764b76ec108f5de24ea7c22ed.zip
chromium_src-91332b626ed0625764b76ec108f5de24ea7c22ed.tar.gz
chromium_src-91332b626ed0625764b76ec108f5de24ea7c22ed.tar.bz2
Fixes a crash in the plugin process specifically in the PluginStreamUrl::DidReceiveData
function. This crash occurs if the PluginStreamUrl instance is deleted in the context of PluginStream::Write which occurs if the underlying NPP_Write call to the plugin returns a negative value, indicating that the plugin did not accept data. We close the stream in this case which releases existing references to the PluginStream which results in the object being deleted. Added a UI test for this case. Fixes bug http://code.google.com/p/chromium/issues/detail?id=19393 Bug=19393 Review URL: http://codereview.chromium.org/199093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26011 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/data/npapi')
-rw-r--r--chrome/test/data/npapi/plugin_read_page.html4
-rw-r--r--chrome/test/data/npapi/plugin_read_page.html.mock-http-headers2
-rw-r--r--chrome/test/data/npapi/plugin_url_request_fail_write.html26
3 files changed, 32 insertions, 0 deletions
diff --git a/chrome/test/data/npapi/plugin_read_page.html b/chrome/test/data/npapi/plugin_read_page.html
new file mode 100644
index 0000000..17bcef8
--- /dev/null
+++ b/chrome/test/data/npapi/plugin_read_page.html
@@ -0,0 +1,4 @@
+<html>
+<head><title>Test page read by plugin</title></head>
+<body>This page has a title.</body>
+</html>
diff --git a/chrome/test/data/npapi/plugin_read_page.html.mock-http-headers b/chrome/test/data/npapi/plugin_read_page.html.mock-http-headers
new file mode 100644
index 0000000..57fae25
--- /dev/null
+++ b/chrome/test/data/npapi/plugin_read_page.html.mock-http-headers
@@ -0,0 +1,2 @@
+HTTP/1.0 200 OK
+Content-type: text/html
diff --git a/chrome/test/data/npapi/plugin_url_request_fail_write.html b/chrome/test/data/npapi/plugin_url_request_fail_write.html
new file mode 100644
index 0000000..ee55af6
--- /dev/null
+++ b/chrome/test/data/npapi/plugin_url_request_fail_write.html
@@ -0,0 +1,26 @@
+<html>
+
+<head>
+<script src="npapi.js"></script>
+</head>
+
+
+<body>
+<div id="statusPanel" style="border: 1px solid red; width: 100%">
+Test running....
+</div>
+
+
+GetURL Plugin Fails NPP_Write Test<p>
+This test fetches a URL and passes data off to the plugin. The plugin returns
+an error from the NPP_Write call. This test verifies that we do not crash
+as a result.
+
+<embed type="application/vnd.npapi-test"
+ fail_write_url="http://mock.http/npapi/plugin_read_page.html"
+ name="geturl_fail_write"
+ id="1"
+ mode="np_embed"
+>
+</body>
+</html>