diff options
Diffstat (limited to 'chrome/test/ui/npapi_uitest.cpp')
-rw-r--r-- | chrome/test/ui/npapi_uitest.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/chrome/test/ui/npapi_uitest.cpp b/chrome/test/ui/npapi_uitest.cpp index 2657220..1da15c46 100644 --- a/chrome/test/ui/npapi_uitest.cpp +++ b/chrome/test/ui/npapi_uitest.cpp @@ -48,6 +48,7 @@ #include "base/file_util.h" #include "chrome/common/chrome_paths.h" #include "chrome/test/automation/tab_proxy.h" +#include "chrome/test/automation/window_proxy.h" #include "chrome/test/ui/npapi_test_helper.h" #include "net/base/net_util.h" @@ -167,6 +168,24 @@ TEST_F(NPAPITester, SelfDeletePluginInvoke) { kShortWaitTimeout); } +// Tests if a plugin executing a self deleting script using Invoke with +// a modal dialog showing works without crashing or hanging +TEST_F(NPAPITester, SelfDeletePluginInvokeAlert) { + std::wstring test_case = L"self_delete_plugin_invoke_alert.html"; + GURL url = GetTestUrl(L"npapi", test_case); + NavigateToURL(url); + + // Wait for the alert dialog and then close it. + automation()->WaitForAppModalDialog(5000); + scoped_ptr<WindowProxy> window(automation()->GetActiveWindow()); + ASSERT_TRUE(window.get()); + ASSERT_TRUE(window->SimulateOSKeyPress(VK_ESCAPE, 0)); + + WaitForFinish("self_delete_plugin_invoke_alert", "1", url, + kTestCompleteCookie, kTestCompleteSuccess, + kShortWaitTimeout); +} + // Tests if a plugin executing a self deleting script in the context of // a synchronous paint event works correctly TEST_F(NPAPIVisiblePluginTester, SelfDeletePluginInvokeInSynchronousPaint) { |