diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-24 00:50:27 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-24 00:50:27 +0000 |
commit | 159c51138bddf2040572a811dcbaa0d3aab35b6d (patch) | |
tree | 6f74b78c0ad113737a1ffb60c8c47e5bf2f2b0de /chrome/test/data/npapi | |
parent | f8a927fc73d83a0ad0fec4daa13b804345eca3df (diff) | |
download | chromium_src-159c51138bddf2040572a811dcbaa0d3aab35b6d.zip chromium_src-159c51138bddf2040572a811dcbaa0d3aab35b6d.tar.gz chromium_src-159c51138bddf2040572a811dcbaa0d3aab35b6d.tar.bz2 |
Add a regression test for the PluginChannel::CleanUp. My earlier speculative fix was correct.
I tracked this down to my earlier change to not leak NPObjects on channel shutdown (which now happens a lot more often because of sudden termination for tab close). Since we now call an NPObject's deallocate function, it's possible that it leads to an NPObjectProxy being deleted, in which case we would delete an object in the listener's array while we're looping across it.
BUG=25439
Review URL: http://codereview.chromium.org/332013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29982 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/data/npapi')
-rw-r--r-- | chrome/test/data/npapi/npobject_released_on_destruction.html | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/chrome/test/data/npapi/npobject_released_on_destruction.html b/chrome/test/data/npapi/npobject_released_on_destruction.html new file mode 100644 index 0000000..f4da25d --- /dev/null +++ b/chrome/test/data/npapi/npobject_released_on_destruction.html @@ -0,0 +1,50 @@ +<html> + +<head> +<script src="npapi.js"></script> +<script> + +function returnedMethod() { +} + +function dummyMethod() { + return returnedMethod; +} + +var test_object; +function Init() { + var plg = window.document["plg"]; + // Create the NPObjectStub in the plugin process first. This object's + // deallocate function will release the NPObject below. + test_object = plg.testCreateTestObject(); + + // Then create an NPObjectProxy in the plugin process that holds on to the + // dummyMethod function above. + test_object.pageTestObject(); +} +</script> +</head> + + +<body> +<div id="statusPanel" style="border: 1px solid red; width: 100%"> +Test running.... +</div> + + +NPObject released on destruction<p> + +Tests that if a plugin creates an NPObject and releases it on destruction, +there's no crash when the plugin goes away. + + +<DIV ID=PluginDiv> +<embed name="plg" type="application/x-webkit-test-netscape"></embed> +</DIV> +<script> + Init(); +</script> + +</body> +</html> + |