OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
10 #include "content/public/common/content_switches.h" | 10 #include "content/public/common/content_switches.h" |
11 #include "content/public/test/browser_test_utils.h" | 11 #include "content/public/test/browser_test_utils.h" |
12 #include "content/shell/shell.h" | 12 #include "content/shell/shell.h" |
13 #include "content/shell/shell_switches.h" | 13 #include "content/shell/shell_switches.h" |
14 #include "content/test/content_browser_test.h" | 14 #include "content/test/content_browser_test.h" |
15 #include "content/test/content_browser_test_utils.h" | 15 #include "content/test/content_browser_test_utils.h" |
16 #include "content/test/net/url_request_mock_http_job.h" | 16 #include "content/test/net/url_request_mock_http_job.h" |
17 #include "ui/gfx/rect.h" | 17 #include "ui/gfx/rect.h" |
18 #include "webkit/plugins/plugin_switches.h" | 18 #include "webkit/plugins/plugin_switches.h" |
19 | 19 |
20 #if defined(OS_WIN) | 20 #if defined(OS_WIN) |
21 #include "base/win/registry.h" | 21 #include "base/win/registry.h" |
22 #endif | 22 #endif |
23 | 23 |
| 24 // TODO(jschuh): Finish plugins on Win64. crbug.com/180861 |
| 25 #if defined(OS_WIN) && defined(ARCH_CPU_X86_64) |
| 26 #define MAYBE(x) DISABLED_##x |
| 27 #else |
| 28 #define MAYBE(x) x |
| 29 #endif |
| 30 |
24 namespace content { | 31 namespace content { |
25 namespace { | 32 namespace { |
26 | 33 |
27 void SetUrlRequestMock(const base::FilePath& path) { | 34 void SetUrlRequestMock(const base::FilePath& path) { |
28 URLRequestMockHTTPJob::AddUrlHandler(path); | 35 URLRequestMockHTTPJob::AddUrlHandler(path); |
29 } | 36 } |
30 | 37 |
31 } | 38 } |
32 | 39 |
33 class PluginTest : public ContentBrowserTest { | 40 class PluginTest : public ContentBrowserTest { |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 #endif | 277 #endif |
271 | 278 |
272 #if defined(OS_WIN) | 279 #if defined(OS_WIN) |
273 | 280 |
274 IN_PROC_BROWSER_TEST_F(PluginTest, VerifyPluginWindowRect) { | 281 IN_PROC_BROWSER_TEST_F(PluginTest, VerifyPluginWindowRect) { |
275 LoadAndWait(GetURL("verify_plugin_window_rect.html")); | 282 LoadAndWait(GetURL("verify_plugin_window_rect.html")); |
276 } | 283 } |
277 | 284 |
278 // Tests that creating a new instance of a plugin while another one is handling | 285 // Tests that creating a new instance of a plugin while another one is handling |
279 // a paint message doesn't cause deadlock. | 286 // a paint message doesn't cause deadlock. |
280 IN_PROC_BROWSER_TEST_F(PluginTest, CreateInstanceInPaint) { | 287 IN_PROC_BROWSER_TEST_F(PluginTest, MAYBE(CreateInstanceInPaint)) { |
281 LoadAndWait(GetURL("create_instance_in_paint.html")); | 288 LoadAndWait(GetURL("create_instance_in_paint.html")); |
282 } | 289 } |
283 | 290 |
284 // Tests that putting up an alert in response to a paint doesn't deadlock. | 291 // Tests that putting up an alert in response to a paint doesn't deadlock. |
285 IN_PROC_BROWSER_TEST_F(PluginTest, DISABLED_AlertInWindowMessage) { | 292 IN_PROC_BROWSER_TEST_F(PluginTest, DISABLED_AlertInWindowMessage) { |
286 NavigateToURL(shell(), GetURL("alert_in_window_message.html")); | 293 NavigateToURL(shell(), GetURL("alert_in_window_message.html")); |
287 | 294 |
288 WaitForAppModalDialog(shell()); | 295 WaitForAppModalDialog(shell()); |
289 WaitForAppModalDialog(shell()); | 296 WaitForAppModalDialog(shell()); |
290 } | 297 } |
291 | 298 |
292 IN_PROC_BROWSER_TEST_F(PluginTest, VerifyNPObjectLifetimeTest) { | 299 IN_PROC_BROWSER_TEST_F(PluginTest, VerifyNPObjectLifetimeTest) { |
293 LoadAndWait(GetURL("npobject_lifetime_test.html")); | 300 LoadAndWait(GetURL("npobject_lifetime_test.html")); |
294 } | 301 } |
295 | 302 |
296 // Tests that we don't crash or assert if NPP_New fails | 303 // Tests that we don't crash or assert if NPP_New fails |
297 IN_PROC_BROWSER_TEST_F(PluginTest, NewFails) { | 304 IN_PROC_BROWSER_TEST_F(PluginTest, NewFails) { |
298 LoadAndWait(GetURL("new_fails.html")); | 305 LoadAndWait(GetURL("new_fails.html")); |
299 } | 306 } |
300 | 307 |
301 IN_PROC_BROWSER_TEST_F(PluginTest, SelfDeletePluginInNPNEvaluate) { | 308 IN_PROC_BROWSER_TEST_F(PluginTest, MAYBE(SelfDeletePluginInNPNEvaluate)) { |
302 LoadAndWait(GetURL("execute_script_delete_in_npn_evaluate.html")); | 309 LoadAndWait(GetURL("execute_script_delete_in_npn_evaluate.html")); |
303 } | 310 } |
304 | 311 |
305 IN_PROC_BROWSER_TEST_F(PluginTest, SelfDeleteCreatePluginInNPNEvaluate) { | 312 IN_PROC_BROWSER_TEST_F(PluginTest, |
| 313 MAYBE(SelfDeleteCreatePluginInNPNEvaluate)) { |
306 LoadAndWait(GetURL("npn_plugin_delete_create_in_evaluate.html")); | 314 LoadAndWait(GetURL("npn_plugin_delete_create_in_evaluate.html")); |
307 } | 315 } |
308 | 316 |
309 #endif // OS_WIN | 317 #endif // OS_WIN |
310 | 318 |
311 // If this flakes, reopen http://crbug.com/17645 | 319 // If this flakes, reopen http://crbug.com/17645 |
312 // As of 6 July 2011, this test is flaky on Windows (perhaps due to timing out). | 320 // As of 6 July 2011, this test is flaky on Windows (perhaps due to timing out). |
313 #if !defined(OS_MACOSX) | 321 #if !defined(OS_MACOSX) |
314 // Disabled on Mac because the plugin side isn't implemented yet, see | 322 // Disabled on Mac because the plugin side isn't implemented yet, see |
315 // "TODO(port)" in plugin_javascript_open_popup.cc. | 323 // "TODO(port)" in plugin_javascript_open_popup.cc. |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 // Windows only test | 415 // Windows only test |
408 IN_PROC_BROWSER_TEST_F(PluginTest, DISABLED_FlashSecurity) { | 416 IN_PROC_BROWSER_TEST_F(PluginTest, DISABLED_FlashSecurity) { |
409 TestPlugin("flash.html"); | 417 TestPlugin("flash.html"); |
410 } | 418 } |
411 #endif // defined(OS_WIN) | 419 #endif // defined(OS_WIN) |
412 | 420 |
413 #if defined(OS_WIN) | 421 #if defined(OS_WIN) |
414 // TODO(port) Port the following tests to platforms that have the required | 422 // TODO(port) Port the following tests to platforms that have the required |
415 // plugins. | 423 // plugins. |
416 // Flaky: http://crbug.com/55915 | 424 // Flaky: http://crbug.com/55915 |
417 IN_PROC_BROWSER_TEST_F(PluginTest, Quicktime) { | 425 IN_PROC_BROWSER_TEST_F(PluginTest, MAYBE(Quicktime)) { |
418 TestPlugin("quicktime.html"); | 426 TestPlugin("quicktime.html"); |
419 } | 427 } |
420 | 428 |
421 // Disabled - http://crbug.com/44662 | 429 // Disabled - http://crbug.com/44662 |
422 IN_PROC_BROWSER_TEST_F(PluginTest, MediaPlayerNew) { | 430 IN_PROC_BROWSER_TEST_F(PluginTest, MediaPlayerNew) { |
423 TestPlugin("wmp_new.html"); | 431 TestPlugin("wmp_new.html"); |
424 } | 432 } |
425 | 433 |
426 // http://crbug.com/4809 | 434 // http://crbug.com/4809 |
427 IN_PROC_BROWSER_TEST_F(PluginTest, DISABLED_MediaPlayerOld) { | 435 IN_PROC_BROWSER_TEST_F(PluginTest, DISABLED_MediaPlayerOld) { |
(...skipping 22 matching lines...) Expand all Loading... |
450 IN_PROC_BROWSER_TEST_F(PluginTest, DISABLED_Java) { | 458 IN_PROC_BROWSER_TEST_F(PluginTest, DISABLED_Java) { |
451 TestPlugin("Java.html"); | 459 TestPlugin("Java.html"); |
452 } | 460 } |
453 | 461 |
454 IN_PROC_BROWSER_TEST_F(PluginTest, Silverlight) { | 462 IN_PROC_BROWSER_TEST_F(PluginTest, Silverlight) { |
455 TestPlugin("silverlight.html"); | 463 TestPlugin("silverlight.html"); |
456 } | 464 } |
457 #endif // defined(OS_WIN) | 465 #endif // defined(OS_WIN) |
458 | 466 |
459 } // namespace content | 467 } // namespace content |
OLD | NEW |