Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: chrome/test/interactive_ui/npapi_interactive_test.cc

Issue 174383: Fixes a crash caused due to a call to NPP_DestroyStream occuring in the conte... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2008, Google Inc. 1 // Copyright 2008, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 14 matching lines...) Expand all
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 29
30 // 30 //
31 // NPAPI interactive UI tests. 31 // NPAPI interactive UI tests.
32 // 32 //
33 33
34 #include "base/file_util.h" 34 #include "base/file_util.h"
35 #include "chrome/browser/net/url_request_mock_http_job.h"
35 #include "chrome/common/chrome_paths.h" 36 #include "chrome/common/chrome_paths.h"
36 #include "chrome/test/automation/tab_proxy.h" 37 #include "chrome/test/automation/tab_proxy.h"
38 #include "chrome/test/automation/window_proxy.h"
37 #include "chrome/test/ui/npapi_test_helper.h" 39 #include "chrome/test/ui/npapi_test_helper.h"
38 #include "net/base/net_util.h" 40 #include "net/base/net_util.h"
39 41
40 const char kTestCompleteCookie[] = "status"; 42 const char kTestCompleteCookie[] = "status";
41 const char kTestCompleteSuccess[] = "OK"; 43 const char kTestCompleteSuccess[] = "OK";
42 const int kShortWaitTimeout = 5 * 1000; 44 const int kShortWaitTimeout = 5 * 1000;
43 45
44 // Tests if a plugin executing a self deleting script in the context of 46 // Tests if a plugin executing a self deleting script in the context of
45 // a synchronous mousemove works correctly 47 // a synchronous mousemove works correctly
46 TEST_F(NPAPIVisiblePluginTester, SelfDeletePluginInvokeInSynchronousMouseMove) { 48 TEST_F(NPAPIVisiblePluginTester, SelfDeletePluginInvokeInSynchronousMouseMove) {
(...skipping 22 matching lines...) Expand all
69 input_info.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE; 71 input_info.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE;
70 input_info.mi.dx = static_cast<long>(location_x); 72 input_info.mi.dx = static_cast<long>(location_x);
71 input_info.mi.dy = static_cast<long>(location_y); 73 input_info.mi.dy = static_cast<long>(location_y);
72 ::SendInput(1, &input_info, sizeof(INPUT)); 74 ::SendInput(1, &input_info, sizeof(INPUT));
73 75
74 WaitForFinish("execute_script_delete_in_mouse_move", "1", url, 76 WaitForFinish("execute_script_delete_in_mouse_move", "1", url,
75 kTestCompleteCookie, kTestCompleteSuccess, 77 kTestCompleteCookie, kTestCompleteSuccess,
76 kShortWaitTimeout); 78 kShortWaitTimeout);
77 } 79 }
78 } 80 }
81
82 TEST_F(NPAPIVisiblePluginTester, GetURLRequest404Response) {
83 if (UITest::in_process_renderer())
84 return;
85
86 GURL url(URLRequestMockHTTPJob::GetMockUrl(
87 L"npapi/plugin_url_request_404.html"));
88
89 NavigateToURL(url);
90
91 // Wait for the alert dialog and then close it.
92 automation()->WaitForAppModalDialog(action_max_timeout_ms());
93 scoped_refptr<WindowProxy> window(automation()->GetActiveWindow());
94 ASSERT_TRUE(window.get());
95 ASSERT_TRUE(window->SimulateOSKeyPress(VK_ESCAPE, 0));
96
97 WaitForFinish("geturl_404_response", "1", url, kTestCompleteCookie,
98 kTestCompleteSuccess, kShortWaitTimeout);
99 }
OLDNEW
« no previous file with comments | « chrome/test/data/npapi/plugin_url_request_404.html ('k') | webkit/glue/plugins/test/plugin_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698