diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-29 00:35:32 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-29 00:35:32 +0000 |
commit | fce8e2fccb2fdb9ed1f52ab9701e5299cec63677 (patch) | |
tree | 83dbf1e38ae5eb063e7757e9ce21d6636563f503 /chrome/test/ui/npapi_uitest.cpp | |
parent | 7c2dbdd0bec7444f895082aed1b4d7b939867a17 (diff) | |
download | chromium_src-fce8e2fccb2fdb9ed1f52ab9701e5299cec63677.zip chromium_src-fce8e2fccb2fdb9ed1f52ab9701e5299cec63677.tar.gz chromium_src-fce8e2fccb2fdb9ed1f52ab9701e5299cec63677.tar.bz2 |
Moved the SelfDeletePluginInvokeInSynchronousMouseMove to interactive ui tests
as we need to simulate mousemoves here. ui tests run on machines which are locked,
causing this test to fail.
Moved the NPAPITester and NPAPIVisiblePluginTester classes to a common file
npapi_test_helper.cc so it can be used from both tests.
Relanding the SetCursor patch. It has already been approved by John.
Description below:-
Proposed fix for http://b/issue?id=1362948, which is a crash in the rendererwhen we invoke the setCursor call on the parent view in WebPluginImpl::handleEvent.
This crash occurs because the plugin is deleted in the context of a mouse down event. This could occur by invoking a javascript function via NPN_Evaluate. On return from the HandleEvent sync call we attempt to retreive the parent frame, which
returns NULL and hence the crash.
The fix is to retreive the parent frameview at the start of the WebPluginImpl::handleMouseEvent function and use it whereever needed.
Added a unit test which deletes the plugin instance in a mousemove event.
R=jam
Bug=1362948
Review URL: http://codereview.chromium.org/8691
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4115 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/ui/npapi_uitest.cpp')
-rw-r--r-- | chrome/test/ui/npapi_uitest.cpp | 42 |
1 files changed, 2 insertions, 40 deletions
diff --git a/chrome/test/ui/npapi_uitest.cpp b/chrome/test/ui/npapi_uitest.cpp index bce1497..2657220 100644 --- a/chrome/test/ui/npapi_uitest.cpp +++ b/chrome/test/ui/npapi_uitest.cpp @@ -48,7 +48,7 @@ #include "base/file_util.h" #include "chrome/common/chrome_paths.h" #include "chrome/test/automation/tab_proxy.h" -#include "chrome/test/ui/ui_test.h" +#include "chrome/test/ui/npapi_test_helper.h" #include "net/base/net_util.h" const char kTestCompleteCookie[] = "status"; @@ -66,44 +66,6 @@ std::ostream& operator<<(std::ostream& out, const CComBSTR &str) return out << szFinal; } -class NPAPITester : public UITest { - protected: - NPAPITester() : UITest() - { - } - - virtual void SetUp() - { - // We need to copy our test-plugin into the plugins directory so that - // the browser can load it. - std::wstring plugins_directory = browser_directory_ + L"\\plugins"; - std::wstring plugin_src = browser_directory_ + L"\\npapi_test_plugin.dll"; - plugin_dll_ = plugins_directory + L"\\npapi_test_plugin.dll"; - - CreateDirectory(plugins_directory.c_str(), NULL); - CopyFile(plugin_src.c_str(), plugin_dll_.c_str(), FALSE); - - UITest::SetUp(); - } - - virtual void TearDown() - { - DeleteFile(plugin_dll_.c_str()); - UITest::TearDown(); - } - -private: - std::wstring plugin_dll_; -}; - -class NPAPIVisiblePluginTester : public NPAPITester { - protected: - virtual void SetUp() { - show_window_ = true; - NPAPITester::SetUp(); - } -}; - // Test passing arguments to a plugin. TEST_F(NPAPITester, Arguments) { std::wstring test_case = L"arguments.html"; @@ -279,4 +241,4 @@ TEST_F(NPAPIVisiblePluginTester, OpenPopupWindowWithPlugin) { WaitForFinish("plugin_popup_with_plugin_target", "1", url, kTestCompleteCookie, kTestCompleteSuccess, kShortWaitTimeout); -}
\ No newline at end of file +} |