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

Side by Side Diff: chrome/test/ui/npapi_uitest.cc

Issue 258026: Fix scripting during NPP_Destroy. Note that if the plugin is making a call t... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // windows headers 5 // windows headers
6 #include <windows.h> 6 #include <windows.h>
7 #include <shellapi.h> 7 #include <shellapi.h>
8 #include <shlobj.h> 8 #include <shlobj.h>
9 #include <comutil.h> 9 #include <comutil.h>
10 10
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 ASSERT_TRUE(window->SimulateOSKeyPress(base::VKEY_ESCAPE, 0)); 152 ASSERT_TRUE(window->SimulateOSKeyPress(base::VKEY_ESCAPE, 0));
153 153
154 WaitForFinish("self_delete_plugin_invoke_alert", "1", url, 154 WaitForFinish("self_delete_plugin_invoke_alert", "1", url,
155 kTestCompleteCookie, kTestCompleteSuccess, 155 kTestCompleteCookie, kTestCompleteSuccess,
156 kShortWaitTimeout); 156 kShortWaitTimeout);
157 } 157 }
158 158
159 // Tests if a plugin executing a self deleting script in the context of 159 // Tests if a plugin executing a self deleting script in the context of
160 // a synchronous paint event works correctly 160 // a synchronous paint event works correctly
161 TEST_F(NPAPIVisiblePluginTester, SelfDeletePluginInvokeInSynchronousPaint) { 161 TEST_F(NPAPIVisiblePluginTester, SelfDeletePluginInvokeInSynchronousPaint) {
162 if (!UITest::in_process_renderer()) { 162 if (UITest::in_process_renderer())
163 show_window_ = true; 163 return;
164 std::wstring test_case = L"execute_script_delete_in_paint.html"; 164
165 GURL url = GetTestUrl(L"npapi", test_case); 165 show_window_ = true;
166 NavigateToURL(url); 166 std::wstring test_case = L"execute_script_delete_in_paint.html";
167 WaitForFinish("execute_script_delete_in_paint", "1", url, 167 GURL url = GetTestUrl(L"npapi", test_case);
168 kTestCompleteCookie, kTestCompleteSuccess, 168 NavigateToURL(url);
169 kShortWaitTimeout); 169 WaitForFinish("execute_script_delete_in_paint", "1", url,
170 } 170 kTestCompleteCookie, kTestCompleteSuccess,
171 kShortWaitTimeout);
171 } 172 }
172 173
173 TEST_F(NPAPIVisiblePluginTester, SelfDeletePluginInNewStream) { 174 TEST_F(NPAPIVisiblePluginTester, SelfDeletePluginInNewStream) {
174 if (!UITest::in_process_renderer()) { 175 if (UITest::in_process_renderer())
175 show_window_ = true; 176 return;
176 std::wstring test_case = L"self_delete_plugin_stream.html"; 177
177 GURL url = GetTestUrl(L"npapi", test_case); 178 show_window_ = true;
178 NavigateToURL(url); 179 std::wstring test_case = L"self_delete_plugin_stream.html";
179 WaitForFinish("self_delete_plugin_stream", "1", url, 180 GURL url = GetTestUrl(L"npapi", test_case);
180 kTestCompleteCookie, kTestCompleteSuccess, 181 NavigateToURL(url);
181 kShortWaitTimeout); 182 WaitForFinish("self_delete_plugin_stream", "1", url,
182 } 183 kTestCompleteCookie, kTestCompleteSuccess,
184 kShortWaitTimeout);
183 } 185 }
184 186
185 // Tests if a plugin has a non zero window rect. 187 // Tests if a plugin has a non zero window rect.
186 TEST_F(NPAPIVisiblePluginTester, VerifyPluginWindowRect) { 188 TEST_F(NPAPIVisiblePluginTester, VerifyPluginWindowRect) {
187 show_window_ = true; 189 show_window_ = true;
188 std::wstring test_case = L"verify_plugin_window_rect.html"; 190 std::wstring test_case = L"verify_plugin_window_rect.html";
189 GURL url = GetTestUrl(L"npapi", test_case); 191 GURL url = GetTestUrl(L"npapi", test_case);
190 NavigateToURL(url); 192 NavigateToURL(url);
191 WaitForFinish("checkwindowrect", "1", url, kTestCompleteCookie, 193 WaitForFinish("checkwindowrect", "1", url, kTestCompleteCookie,
192 kTestCompleteSuccess, kShortWaitTimeout); 194 kTestCompleteSuccess, kShortWaitTimeout);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 &available_buttons)); 230 &available_buttons));
229 ASSERT_TRUE(modal_dialog_showing); 231 ASSERT_TRUE(modal_dialog_showing);
230 ASSERT_NE((MessageBoxFlags::DIALOGBUTTON_OK & available_buttons), 0); 232 ASSERT_NE((MessageBoxFlags::DIALOGBUTTON_OK & available_buttons), 0);
231 ASSERT_TRUE(automation()->ClickAppModalDialogButton( 233 ASSERT_TRUE(automation()->ClickAppModalDialogButton(
232 MessageBoxFlags::DIALOGBUTTON_OK)); 234 MessageBoxFlags::DIALOGBUTTON_OK));
233 } 235 }
234 236
235 #endif 237 #endif
236 238
237 TEST_F(NPAPIVisiblePluginTester, VerifyNPObjectLifetimeTest) { 239 TEST_F(NPAPIVisiblePluginTester, VerifyNPObjectLifetimeTest) {
238 if (!UITest::in_process_renderer()) { 240 if (UITest::in_process_renderer())
239 show_window_ = true; 241 return;
240 std::wstring test_case = L"npobject_lifetime_test.html"; 242
241 GURL url = GetTestUrl(L"npapi", test_case); 243 show_window_ = true;
242 NavigateToURL(url); 244 std::wstring test_case = L"npobject_lifetime_test.html";
243 WaitForFinish("npobject_lifetime_test", "1", url, 245 GURL url = GetTestUrl(L"npapi", test_case);
244 kTestCompleteCookie, kTestCompleteSuccess, 246 NavigateToURL(url);
245 kShortWaitTimeout); 247 WaitForFinish("npobject_lifetime_test", "1", url,
246 } 248 kTestCompleteCookie, kTestCompleteSuccess,
249 kShortWaitTimeout);
247 } 250 }
248 251
249 // Tests that we don't crash or assert if NPP_New fails 252 // Tests that we don't crash or assert if NPP_New fails
250 TEST_F(NPAPIVisiblePluginTester, NewFails) { 253 TEST_F(NPAPIVisiblePluginTester, NewFails) {
251 GURL url = GetTestUrl(L"npapi", L"new_fails.html"); 254 GURL url = GetTestUrl(L"npapi", L"new_fails.html");
252 NavigateToURL(url); 255 NavigateToURL(url);
253 WaitForFinish("new_fails", "1", url, kTestCompleteCookie, 256 WaitForFinish("new_fails", "1", url, kTestCompleteCookie,
254 kTestCompleteSuccess, kShortWaitTimeout); 257 kTestCompleteSuccess, kShortWaitTimeout);
255 } 258 }
256 259
257 TEST_F(NPAPIVisiblePluginTester, SelfDeletePluginInNPNEvaluate) { 260 TEST_F(NPAPIVisiblePluginTester, SelfDeletePluginInNPNEvaluate) {
258 if (!UITest::in_process_renderer()) { 261 if (UITest::in_process_renderer())
259 GURL url = GetTestUrl(L"npapi", 262 return;
260 L"execute_script_delete_in_npn_evaluate.html"); 263
261 NavigateToURL(url); 264 GURL url = GetTestUrl(L"npapi",
262 WaitForFinish("npobject_delete_plugin_in_evaluate", "1", url, 265 L"execute_script_delete_in_npn_evaluate.html");
263 kTestCompleteCookie, kTestCompleteSuccess, 266 NavigateToURL(url);
264 kShortWaitTimeout); 267 WaitForFinish("npobject_delete_plugin_in_evaluate", "1", url,
265 } 268 kTestCompleteCookie, kTestCompleteSuccess,
269 kShortWaitTimeout);
266 } 270 }
267 271
268 // Flaky. See http://crbug.com/17645 272 // Flaky. See http://crbug.com/17645
269 TEST_F(NPAPIVisiblePluginTester, DISABLED_OpenPopupWindowWithPlugin) { 273 TEST_F(NPAPIVisiblePluginTester, DISABLED_OpenPopupWindowWithPlugin) {
270 GURL url = GetTestUrl(L"npapi", 274 GURL url = GetTestUrl(L"npapi",
271 L"get_javascript_open_popup_with_plugin.html"); 275 L"get_javascript_open_popup_with_plugin.html");
272 NavigateToURL(url); 276 NavigateToURL(url);
273 WaitForFinish("plugin_popup_with_plugin_target", "1", url, 277 WaitForFinish("plugin_popup_with_plugin_target", "1", url,
274 kTestCompleteCookie, kTestCompleteSuccess, 278 kTestCompleteCookie, kTestCompleteSuccess,
275 action_timeout_ms()); 279 action_timeout_ms());
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 return; 318 return;
315 319
316 GURL url(URLRequestMockHTTPJob::GetMockUrl( 320 GURL url(URLRequestMockHTTPJob::GetMockUrl(
317 L"npapi/plugin_url_request_fail_write.html")); 321 L"npapi/plugin_url_request_fail_write.html"));
318 322
319 NavigateToURL(url); 323 NavigateToURL(url);
320 324
321 WaitForFinish("geturl_fail_write", "1", url, kTestCompleteCookie, 325 WaitForFinish("geturl_fail_write", "1", url, kTestCompleteCookie,
322 kTestCompleteSuccess, kShortWaitTimeout); 326 kTestCompleteSuccess, kShortWaitTimeout);
323 } 327 }
328
329 TEST_F(NPAPITester, EnsureScriptingWorksInDestroy) {
330 if (UITest::in_process_renderer())
331 return;
332
333 GURL url = GetTestUrl(L"npapi", L"ensure_scripting_works_in_destroy.html");
334 NavigateToURL(url);
335 WaitForFinish("ensure_scripting_works_in_destroy", "1", url,
336 kTestCompleteCookie, kTestCompleteSuccess,
337 kShortWaitTimeout);
338 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698