diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-23 19:22:00 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-23 19:22:00 +0000 |
commit | 90aca24d74f13b7fb864caafb92e088a91b15903 (patch) | |
tree | 05bc6c5edeecefa91d06a6404f3925644e633b57 /webkit/glue | |
parent | d3ef5942dc19d90fe64e721c0733573d4a89caa5 (diff) | |
download | chromium_src-90aca24d74f13b7fb864caafb92e088a91b15903.zip chromium_src-90aca24d74f13b7fb864caafb92e088a91b15903.tar.gz chromium_src-90aca24d74f13b7fb864caafb92e088a91b15903.tar.bz2 |
Add a regression test for the renderer hang when a plugin's NP_Initialize function crashes.
BUG=25104
Review URL: http://codereview.chromium.org/337004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29923 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r-- | webkit/glue/plugins/test/plugin_client.cc | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/webkit/glue/plugins/test/plugin_client.cc b/webkit/glue/plugins/test/plugin_client.cc index 34b814f..1146a6a 100644 --- a/webkit/glue/plugins/test/plugin_client.cc +++ b/webkit/glue/plugins/test/plugin_client.cc @@ -1,7 +1,11 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#if defined(OS_WIN) +#include <windows.h> +#endif + #include "base/string_util.h" #include "webkit/glue/plugins/test/plugin_client.h" #include "webkit/glue/plugins/test/plugin_arguments_test.h" @@ -62,6 +66,16 @@ NPError PluginClient::Initialize(NPNetscapeFuncs* pFuncs) { return NPERR_INCOMPATIBLE_VERSION_ERROR; } +#if defined(OS_WIN) + // Check if we should crash. + HANDLE crash_event = CreateEvent(NULL, TRUE, FALSE, L"TestPluginCrashOnInit"); + if (WaitForSingleObject(crash_event, 0) == WAIT_OBJECT_0) { + int *zero = NULL; + *zero = 0; + } + CloseHandle(crash_event); +#endif + host_functions_ = pFuncs; return NPERR_NO_ERROR; @@ -112,7 +126,8 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, } else if (test_name == "execute_script_delete_in_paint" || test_name == "execute_script_delete_in_mouse_move" || test_name == "delete_frame_test" || - test_name == "multiple_instances_sync_calls") { + test_name == "multiple_instances_sync_calls" || + test_name == "no_hang_if_init_crashes") { new_test = new NPAPIClient::WindowlessPluginTest(instance, NPAPIClient::PluginClient::HostFunctions(), test_name); windowless_plugin = true; |