| 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 #include <set> | 6 #include <set> |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 3383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3394 } | 3394 } |
| 3395 | 3395 |
| 3396 private: | 3396 private: |
| 3397 DISALLOW_COPY_AND_ASSIGN(WebViewGuestScrollTest); | 3397 DISALLOW_COPY_AND_ASSIGN(WebViewGuestScrollTest); |
| 3398 }; | 3398 }; |
| 3399 | 3399 |
| 3400 class WebViewGuestScrollTouchTest : public WebViewGuestScrollTest { | 3400 class WebViewGuestScrollTouchTest : public WebViewGuestScrollTest { |
| 3401 protected: | 3401 protected: |
| 3402 void SetUpCommandLine(base::CommandLine* command_line) override { | 3402 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 3403 WebViewGuestScrollTest::SetUpCommandLine(command_line); | 3403 WebViewGuestScrollTest::SetUpCommandLine(command_line); |
| 3404 | |
| 3405 command_line->AppendSwitchASCII(switches::kTouchEvents, | |
| 3406 switches::kTouchEventsEnabled); | |
| 3407 } | 3404 } |
| 3408 }; | 3405 }; |
| 3409 | 3406 |
| 3410 namespace { | 3407 namespace { |
| 3411 | 3408 |
| 3412 class ScrollWaiter { | 3409 class ScrollWaiter { |
| 3413 public: | 3410 public: |
| 3414 explicit ScrollWaiter(content::RenderWidgetHostView* host_view) | 3411 explicit ScrollWaiter(content::RenderWidgetHostView* host_view) |
| 3415 : host_view_(host_view) {} | 3412 : host_view_(host_view) {} |
| 3416 ~ScrollWaiter() {} | 3413 ~ScrollWaiter() {} |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3516 INSTANTIATE_TEST_CASE_P(WebViewScrollBubbling, | 3513 INSTANTIATE_TEST_CASE_P(WebViewScrollBubbling, |
| 3517 WebViewGuestScrollTouchTest, | 3514 WebViewGuestScrollTouchTest, |
| 3518 testing::Combine(testing::Bool(), testing::Bool())); | 3515 testing::Combine(testing::Bool(), testing::Bool())); |
| 3519 | 3516 |
| 3520 #if defined(USE_AURA) | 3517 #if defined(USE_AURA) |
| 3521 class WebViewGuestTouchFocusTest : public WebViewTestBase { | 3518 class WebViewGuestTouchFocusTest : public WebViewTestBase { |
| 3522 public: | 3519 public: |
| 3523 WebViewGuestTouchFocusTest() {} | 3520 WebViewGuestTouchFocusTest() {} |
| 3524 void SetUpCommandLine(base::CommandLine* command_line) override { | 3521 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 3525 WebViewTestBase::SetUpCommandLine(command_line); | 3522 WebViewTestBase::SetUpCommandLine(command_line); |
| 3526 | |
| 3527 command_line->AppendSwitchASCII(switches::kTouchEvents, | |
| 3528 switches::kTouchEventsEnabled); | |
| 3529 } | 3523 } |
| 3530 | 3524 |
| 3531 private: | 3525 private: |
| 3532 DISALLOW_COPY_AND_ASSIGN(WebViewGuestTouchFocusTest); | 3526 DISALLOW_COPY_AND_ASSIGN(WebViewGuestTouchFocusTest); |
| 3533 }; | 3527 }; |
| 3534 | 3528 |
| 3535 class FocusChangeWaiter { | 3529 class FocusChangeWaiter { |
| 3536 public: | 3530 public: |
| 3537 explicit FocusChangeWaiter(content::WebContents* web_contents, | 3531 explicit FocusChangeWaiter(content::WebContents* web_contents, |
| 3538 bool expected_focus) | 3532 bool expected_focus) |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3684 waiter.WaitForScrollChange(gfx::Vector2dF()); | 3678 waiter.WaitForScrollChange(gfx::Vector2dF()); |
| 3685 } | 3679 } |
| 3686 } | 3680 } |
| 3687 | 3681 |
| 3688 class WebViewScrollGuestContentTest : public WebViewTest { | 3682 class WebViewScrollGuestContentTest : public WebViewTest { |
| 3689 public: | 3683 public: |
| 3690 ~WebViewScrollGuestContentTest() override {} | 3684 ~WebViewScrollGuestContentTest() override {} |
| 3691 | 3685 |
| 3692 void SetUpCommandLine(base::CommandLine* command_line) override { | 3686 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 3693 WebViewTest::SetUpCommandLine(command_line); | 3687 WebViewTest::SetUpCommandLine(command_line); |
| 3694 | |
| 3695 command_line->AppendSwitchASCII(switches::kTouchEvents, | |
| 3696 switches::kTouchEventsEnabled); | |
| 3697 } | 3688 } |
| 3698 }; | 3689 }; |
| 3699 | 3690 |
| 3700 INSTANTIATE_TEST_CASE_P(WebViewScrollGuestContent, | 3691 INSTANTIATE_TEST_CASE_P(WebViewScrollGuestContent, |
| 3701 WebViewScrollGuestContentTest, | 3692 WebViewScrollGuestContentTest, |
| 3702 testing::Values(false)); | 3693 testing::Values(false)); |
| 3703 | 3694 |
| 3704 IN_PROC_BROWSER_TEST_P(WebViewScrollGuestContentTest, ScrollGuestContent) { | 3695 IN_PROC_BROWSER_TEST_P(WebViewScrollGuestContentTest, ScrollGuestContent) { |
| 3705 LoadAppWithGuest("web_view/scrollable_embedder_and_guest"); | 3696 LoadAppWithGuest("web_view/scrollable_embedder_and_guest"); |
| 3706 | 3697 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3760 #if defined(USE_AURA) | 3751 #if defined(USE_AURA) |
| 3761 // TODO(wjmaclean): when WebViewTest is re-enabled on the site-isolation | 3752 // TODO(wjmaclean): when WebViewTest is re-enabled on the site-isolation |
| 3762 // bots, then re-enable this test class as well. | 3753 // bots, then re-enable this test class as well. |
| 3763 // https://crbug.com/503751 | 3754 // https://crbug.com/503751 |
| 3764 class WebViewFocusTest : public WebViewTest { | 3755 class WebViewFocusTest : public WebViewTest { |
| 3765 public: | 3756 public: |
| 3766 ~WebViewFocusTest() override {} | 3757 ~WebViewFocusTest() override {} |
| 3767 | 3758 |
| 3768 void SetUpCommandLine(base::CommandLine* command_line) override { | 3759 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 3769 WebViewTest::SetUpCommandLine(command_line); | 3760 WebViewTest::SetUpCommandLine(command_line); |
| 3770 | |
| 3771 command_line->AppendSwitchASCII(switches::kTouchEvents, | |
| 3772 switches::kTouchEventsEnabled); | |
| 3773 } | 3761 } |
| 3774 | 3762 |
| 3775 void ForceCompositorFrame() { | 3763 void ForceCompositorFrame() { |
| 3776 if (!frame_watcher_) { | 3764 if (!frame_watcher_) { |
| 3777 frame_watcher_ = new content::FrameWatcher(); | 3765 frame_watcher_ = new content::FrameWatcher(); |
| 3778 frame_watcher_->AttachTo(GetEmbedderWebContents()); | 3766 frame_watcher_->AttachTo(GetEmbedderWebContents()); |
| 3779 } | 3767 } |
| 3780 | 3768 |
| 3781 while (!RequestFrame(GetEmbedderWebContents())) { | 3769 while (!RequestFrame(GetEmbedderWebContents())) { |
| 3782 // RequestFrame failed because we were waiting on an ack ... wait a short | 3770 // RequestFrame failed because we were waiting on an ack ... wait a short |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3852 gfx::Point embedder_origin = | 3840 gfx::Point embedder_origin = |
| 3853 GetEmbedderWebContents()->GetContainerBounds().origin(); | 3841 GetEmbedderWebContents()->GetContainerBounds().origin(); |
| 3854 guest_rect.Offset(-embedder_origin.x(), -embedder_origin.y()); | 3842 guest_rect.Offset(-embedder_origin.x(), -embedder_origin.y()); |
| 3855 | 3843 |
| 3856 // Generate and send synthetic touch event. | 3844 // Generate and send synthetic touch event. |
| 3857 content::SimulateTouchPressAt(GetEmbedderWebContents(), | 3845 content::SimulateTouchPressAt(GetEmbedderWebContents(), |
| 3858 guest_rect.CenterPoint()); | 3846 guest_rect.CenterPoint()); |
| 3859 EXPECT_TRUE(aura_webview->HasFocus()); | 3847 EXPECT_TRUE(aura_webview->HasFocus()); |
| 3860 } | 3848 } |
| 3861 #endif | 3849 #endif |
| OLD | NEW |