| 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 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 | 862 |
| 863 class WebViewSizeTest : public WebViewTest {}; | 863 class WebViewSizeTest : public WebViewTest {}; |
| 864 INSTANTIATE_TEST_CASE_P(WebViewTests, WebViewSizeTest, testing::Bool()); | 864 INSTANTIATE_TEST_CASE_P(WebViewTests, WebViewSizeTest, testing::Bool()); |
| 865 | 865 |
| 866 class WebViewVisibilityTest : public WebViewTest {}; | 866 class WebViewVisibilityTest : public WebViewTest {}; |
| 867 INSTANTIATE_TEST_CASE_P(WebViewTests, WebViewVisibilityTest, testing::Bool()); | 867 INSTANTIATE_TEST_CASE_P(WebViewTests, WebViewVisibilityTest, testing::Bool()); |
| 868 | 868 |
| 869 class WebViewSpeechAPITest : public WebViewTest {}; | 869 class WebViewSpeechAPITest : public WebViewTest {}; |
| 870 INSTANTIATE_TEST_CASE_P(WebViewTests, WebViewSpeechAPITest, testing::Bool()); | 870 INSTANTIATE_TEST_CASE_P(WebViewTests, WebViewSpeechAPITest, testing::Bool()); |
| 871 | 871 |
| 872 // The following test suits are created to group tests based on specific | 872 // The following test suites are created to group tests based on specific |
| 873 // features of <webview>. | 873 // features of <webview>. |
| 874 // These features current would not work with | 874 // These features currently would not work with |
| 875 // --use-cross-process-frames-for-guest and is disabled on | 875 // --use-cross-process-frames-for-guest and is disabled on |
| 876 // UseCrossProcessFramesForGuests. | 876 // UseCrossProcessFramesForGuests. |
| 877 // TODO(avallee): https://crbug.com/610795: Enable this for testing::Bool(). |
| 877 class WebViewAccessibilityTest : public WebViewTest {}; | 878 class WebViewAccessibilityTest : public WebViewTest {}; |
| 878 INSTANTIATE_TEST_CASE_P(WebViewTests, | 879 INSTANTIATE_TEST_CASE_P(WebViewTests, |
| 879 WebViewAccessibilityTest, | 880 WebViewAccessibilityTest, |
| 880 testing::Values(false)); | 881 testing::Values(false)); |
| 881 | 882 |
| 882 | 883 |
| 883 class WebViewDPITest : public WebViewTest { | 884 class WebViewDPITest : public WebViewTest { |
| 884 protected: | 885 protected: |
| 885 void SetUpCommandLine(base::CommandLine* command_line) override { | 886 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 886 WebViewTest::SetUpCommandLine(command_line); | 887 WebViewTest::SetUpCommandLine(command_line); |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1250 ASSERT_EQ(1u, guest_contents_list.size()); | 1251 ASSERT_EQ(1u, guest_contents_list.size()); |
| 1251 content::WebContents* guest_contents = guest_contents_list[0]; | 1252 content::WebContents* guest_contents = guest_contents_list[0]; |
| 1252 | 1253 |
| 1253 const gfx::Rect embedder_rect = embedder_contents->GetContainerBounds(); | 1254 const gfx::Rect embedder_rect = embedder_contents->GetContainerBounds(); |
| 1254 const gfx::Rect guest_rect = guest_contents->GetContainerBounds(); | 1255 const gfx::Rect guest_rect = guest_contents->GetContainerBounds(); |
| 1255 const gfx::Point click_point(guest_rect.x() - embedder_rect.x() + 10, | 1256 const gfx::Point click_point(guest_rect.x() - embedder_rect.x() + 10, |
| 1256 guest_rect.y() - embedder_rect.y() + 10); | 1257 guest_rect.y() - embedder_rect.y() + 10); |
| 1257 | 1258 |
| 1258 // Important, pass mouse click to embedder in order to transfer focus. Note | 1259 // Important, pass mouse click to embedder in order to transfer focus. Note |
| 1259 // that SelectControlWaiter may be waited ealier than click is completed. | 1260 // that SelectControlWaiter may be waited ealier than click is completed. |
| 1260 LeftMouseClick mouse_click(embedder_contents); | 1261 LeftMouseClick mouse_click(GetParam() ? guest_contents : embedder_contents); |
| 1261 SelectControlWaiter select_control_waiter; | 1262 SelectControlWaiter select_control_waiter; |
| 1262 | 1263 |
| 1263 for (int i = 0; i < 5; ++i) { | 1264 for (int i = 0; i < 5; ++i) { |
| 1264 const int click_duration_ms = 10 + i * 25; | 1265 const int click_duration_ms = 10 + i * 25; |
| 1265 mouse_click.Click(click_point, click_duration_ms); | 1266 mouse_click.Click(click_point, click_duration_ms); |
| 1266 select_control_waiter.Wait(true); | 1267 select_control_waiter.Wait(true); |
| 1267 mouse_click.Wait(); | 1268 mouse_click.Wait(); |
| 1268 | 1269 |
| 1269 mouse_click.Click(click_point, click_duration_ms); | 1270 mouse_click.Click(click_point, click_duration_ms); |
| 1270 select_control_waiter.Wait(false); | 1271 select_control_waiter.Wait(false); |
| (...skipping 2544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3815 gfx::Point embedder_origin = | 3816 gfx::Point embedder_origin = |
| 3816 GetEmbedderWebContents()->GetContainerBounds().origin(); | 3817 GetEmbedderWebContents()->GetContainerBounds().origin(); |
| 3817 guest_rect.Offset(-embedder_origin.x(), -embedder_origin.y()); | 3818 guest_rect.Offset(-embedder_origin.x(), -embedder_origin.y()); |
| 3818 | 3819 |
| 3819 // Generate and send synthetic touch event. | 3820 // Generate and send synthetic touch event. |
| 3820 content::SimulateTouchPressAt(GetEmbedderWebContents(), | 3821 content::SimulateTouchPressAt(GetEmbedderWebContents(), |
| 3821 guest_rect.CenterPoint()); | 3822 guest_rect.CenterPoint()); |
| 3822 EXPECT_TRUE(aura_webview->HasFocus()); | 3823 EXPECT_TRUE(aura_webview->HasFocus()); |
| 3823 } | 3824 } |
| 3824 #endif | 3825 #endif |
| OLD | NEW |