OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <queue> | 5 #include <queue> |
6 | 6 |
7 #include "base/location.h" | 7 #include "base/location.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/process/process.h" | 9 #include "base/process/process.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
13 #include "base/thread_task_runner_handle.h" | 13 #include "base/thread_task_runner_handle.h" |
14 #include "chrome/app/chrome_command_ids.h" | 14 #include "chrome/app/chrome_command_ids.h" |
15 #include "chrome/browser/apps/app_browsertest_util.h" | 15 #include "chrome/browser/apps/app_browsertest_util.h" |
16 #include "chrome/browser/chrome_content_browser_client.h" | 16 #include "chrome/browser/chrome_content_browser_client.h" |
17 #include "chrome/browser/lifetime/application_lifetime.h" | 17 #include "chrome/browser/lifetime/application_lifetime.h" |
| 18 #include "chrome/browser/pdf/pdf_extension_test_util.h" |
18 #include "chrome/browser/prerender/prerender_link_manager.h" | 19 #include "chrome/browser/prerender/prerender_link_manager.h" |
19 #include "chrome/browser/prerender/prerender_link_manager_factory.h" | 20 #include "chrome/browser/prerender/prerender_link_manager_factory.h" |
20 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
21 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" | 22 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" |
22 #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_uti
l.h" | 23 #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_uti
l.h" |
23 #include "chrome/browser/task_manager/task_manager_browsertest_util.h" | 24 #include "chrome/browser/task_manager/task_manager_browsertest_util.h" |
24 #include "chrome/browser/ui/browser.h" | 25 #include "chrome/browser/ui/browser.h" |
25 #include "chrome/browser/ui/browser_dialogs.h" | 26 #include "chrome/browser/ui/browser_dialogs.h" |
26 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 27 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
27 #include "chrome/test/base/ui_test_utils.h" | 28 #include "chrome/test/base/ui_test_utils.h" |
(...skipping 2425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2453 gvm->WaitForLastGuestDeleted(); | 2454 gvm->WaitForLastGuestDeleted(); |
2454 ASSERT_EQ(gvm->num_embedder_processes_destroyed(), 0); | 2455 ASSERT_EQ(gvm->num_embedder_processes_destroyed(), 0); |
2455 } | 2456 } |
2456 | 2457 |
2457 // Ensure that focusing a WebView while it is already focused does not blur the | 2458 // Ensure that focusing a WebView while it is already focused does not blur the |
2458 // guest content. | 2459 // guest content. |
2459 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestFocusWhileFocused) { | 2460 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestFocusWhileFocused) { |
2460 TestHelper("testFocusWhileFocused", "web_view/shim", NO_TEST_SERVER); | 2461 TestHelper("testFocusWhileFocused", "web_view/shim", NO_TEST_SERVER); |
2461 } | 2462 } |
2462 | 2463 |
| 2464 IN_PROC_BROWSER_TEST_F(WebViewTest, NestedGuestContainerBounds) { |
| 2465 TestHelper("testPDFInWebview", "web_view/shim", NO_TEST_SERVER); |
| 2466 |
| 2467 std::vector<content::WebContents*> guest_web_contents_list; |
| 2468 GetGuestViewManager()->WaitForNumGuestsCreated(2u); |
| 2469 GetGuestViewManager()->GetGuestWebContentsList(&guest_web_contents_list); |
| 2470 ASSERT_EQ(2u, guest_web_contents_list.size()); |
| 2471 |
| 2472 content::WebContents* web_view_contents = guest_web_contents_list[0]; |
| 2473 content::WebContents* mime_handler_view_contents = guest_web_contents_list[1]; |
| 2474 |
| 2475 // Make sure we've completed loading |mime_handler_view_guest|. |
| 2476 bool load_success = pdf_extension_test_util::EnsurePDFHasLoaded( |
| 2477 web_view_contents); |
| 2478 EXPECT_TRUE(load_success); |
| 2479 |
| 2480 gfx::Rect web_view_container_bounds = web_view_contents->GetContainerBounds(); |
| 2481 gfx::Rect mime_handler_view_container_bounds = |
| 2482 mime_handler_view_contents->GetContainerBounds(); |
| 2483 EXPECT_EQ(web_view_container_bounds.origin(), |
| 2484 mime_handler_view_container_bounds.origin()); |
| 2485 } |
| 2486 |
2463 #if defined(USE_AURA) | 2487 #if defined(USE_AURA) |
2464 // TODO(wjmaclean): when WebViewTest is re-enabled on the site-isolation | 2488 // TODO(wjmaclean): when WebViewTest is re-enabled on the site-isolation |
2465 // bots, then re-enable this test class as well. | 2489 // bots, then re-enable this test class as well. |
2466 // https://crbug.com/503751 | 2490 // https://crbug.com/503751 |
2467 class WebViewFocusTest : public WebViewTest { | 2491 class WebViewFocusTest : public WebViewTest { |
2468 public: | 2492 public: |
2469 ~WebViewFocusTest() override {} | 2493 ~WebViewFocusTest() override {} |
2470 | 2494 |
2471 void SetUpCommandLine(base::CommandLine* command_line) override { | 2495 void SetUpCommandLine(base::CommandLine* command_line) override { |
2472 WebViewTest::SetUpCommandLine(command_line); | 2496 WebViewTest::SetUpCommandLine(command_line); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2590 // Generate and send synthetic touch event. | 2614 // Generate and send synthetic touch event. |
2591 FocusWaiter waiter(aura_webview); | 2615 FocusWaiter waiter(aura_webview); |
2592 content::SimulateTouchPressAt(GetEmbedderWebContents(), | 2616 content::SimulateTouchPressAt(GetEmbedderWebContents(), |
2593 guest_rect.CenterPoint()); | 2617 guest_rect.CenterPoint()); |
2594 | 2618 |
2595 // Wait for the TouchStart to propagate and restore focus. Test times out | 2619 // Wait for the TouchStart to propagate and restore focus. Test times out |
2596 // on failure. | 2620 // on failure. |
2597 waiter.Wait(); | 2621 waiter.Wait(); |
2598 } | 2622 } |
2599 #endif | 2623 #endif |
OLD | NEW |