Commit 09d21dec authored by jonross's avatar jonross Committed by Commit Bot

Update More content_browsertests to use new hit test api

This updates some of SitePerProcessBrowserTests, PointerLockBrowserTests, and TouchSelectionForCrossProcessFramesTests to use the new hit testing api.

Based on: https://chromium-review.googlesource.com/c/chromium/src/+/1071886

TBR=piman@chromium.org
TEST= SitePerProcessBrowserTests,
PointerLockBrowserTests,
TouchSelectionForCrossProcessFramesTests

Bug: 785986
Change-Id: Ic3d7aca3f214d0ca0c1952e1f29b84a5ac31e13c
Reviewed-on: https://chromium-review.googlesource.com/1082573
Commit-Queue: Jonathan Ross <jonross@chromium.org>
Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566806}
parent 7d50f07e
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "content/public/test/browser_test_utils.h" #include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test.h" #include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_utils.h" #include "content/public/test/content_browser_test_utils.h"
#include "content/public/test/hit_test_region_observer.h"
#include "content/public/test/test_utils.h" #include "content/public/test/test_utils.h"
#include "content/shell/browser/shell.h" #include "content/shell/browser/shell.h"
#include "content/test/content_browser_test_utils_internal.h" #include "content/test/content_browser_test_utils_internal.h"
...@@ -179,7 +180,7 @@ IN_PROC_BROWSER_TEST_F(PointerLockBrowserTest, PointerLockEventRouting) { ...@@ -179,7 +180,7 @@ IN_PROC_BROWSER_TEST_F(PointerLockBrowserTest, PointerLockEventRouting) {
RenderWidgetHostViewBase* child_view = static_cast<RenderWidgetHostViewBase*>( RenderWidgetHostViewBase* child_view = static_cast<RenderWidgetHostViewBase*>(
child->current_frame_host()->GetView()); child->current_frame_host()->GetView());
WaitForChildFrameSurfaceReady(child->current_frame_host()); WaitForHitTestDataOrChildSurfaceReady(child->current_frame_host());
// Request a pointer lock on the root frame's body. // Request a pointer lock on the root frame's body.
EXPECT_TRUE(ExecuteScript(root, "document.body.requestPointerLock()")); EXPECT_TRUE(ExecuteScript(root, "document.body.requestPointerLock()"));
...@@ -397,7 +398,7 @@ IN_PROC_BROWSER_TEST_F(PointerLockBrowserTest, PointerLockWheelEventRouting) { ...@@ -397,7 +398,7 @@ IN_PROC_BROWSER_TEST_F(PointerLockBrowserTest, PointerLockWheelEventRouting) {
RenderWidgetHostViewBase* child_view = static_cast<RenderWidgetHostViewBase*>( RenderWidgetHostViewBase* child_view = static_cast<RenderWidgetHostViewBase*>(
child->current_frame_host()->GetView()); child->current_frame_host()->GetView());
WaitForChildFrameSurfaceReady(child->current_frame_host()); WaitForHitTestDataOrChildSurfaceReady(child->current_frame_host());
// Request a pointer lock on the root frame's body. // Request a pointer lock on the root frame's body.
EXPECT_TRUE(ExecuteScript(root, "document.body.requestPointerLock()")); EXPECT_TRUE(ExecuteScript(root, "document.body.requestPointerLock()"));
...@@ -522,7 +523,7 @@ IN_PROC_BROWSER_TEST_F(PointerLockBrowserTest, PointerLockWidgetHidden) { ...@@ -522,7 +523,7 @@ IN_PROC_BROWSER_TEST_F(PointerLockBrowserTest, PointerLockWidgetHidden) {
RenderWidgetHostViewBase* child_view = static_cast<RenderWidgetHostViewBase*>( RenderWidgetHostViewBase* child_view = static_cast<RenderWidgetHostViewBase*>(
child->current_frame_host()->GetView()); child->current_frame_host()->GetView());
WaitForChildFrameSurfaceReady(child->current_frame_host()); WaitForHitTestDataOrChildSurfaceReady(child->current_frame_host());
// Request a pointer lock on the child frame's body. // Request a pointer lock on the child frame's body.
EXPECT_TRUE(ExecuteScript(child, "document.body.requestPointerLock()")); EXPECT_TRUE(ExecuteScript(child, "document.body.requestPointerLock()"));
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "content/public/test/browser_test_utils.h" #include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test.h" #include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_utils.h" #include "content/public/test/content_browser_test_utils.h"
#include "content/public/test/hit_test_region_observer.h"
#include "content/public/test/scoped_overscroll_modes.h" #include "content/public/test/scoped_overscroll_modes.h"
#include "content/public/test/test_navigation_observer.h" #include "content/public/test/test_navigation_observer.h"
#include "content/public/test/test_utils.h" #include "content/public/test/test_utils.h"
...@@ -422,7 +423,7 @@ IN_PROC_BROWSER_TEST_P(TouchSelectionControllerClientAuraSiteIsolationTest, ...@@ -422,7 +423,7 @@ IN_PROC_BROWSER_TEST_P(TouchSelectionControllerClientAuraSiteIsolationTest,
// The child will change with the cross-site navigation. It shouldn't change // The child will change with the cross-site navigation. It shouldn't change
// after this. // after this.
child = root->child_at(0); child = root->child_at(0);
WaitForChildFrameSurfaceReady(child->current_frame_host()); WaitForHitTestDataOrChildSurfaceReady(child->current_frame_host());
RenderWidgetHostViewChildFrame* child_view = RenderWidgetHostViewChildFrame* child_view =
static_cast<RenderWidgetHostViewChildFrame*>( static_cast<RenderWidgetHostViewChildFrame*>(
...@@ -529,7 +530,7 @@ IN_PROC_BROWSER_TEST_P(TouchSelectionControllerClientAuraSiteIsolationTest, ...@@ -529,7 +530,7 @@ IN_PROC_BROWSER_TEST_P(TouchSelectionControllerClientAuraSiteIsolationTest,
// The child will change with the cross-site navigation. It shouldn't change // The child will change with the cross-site navigation. It shouldn't change
// after this. // after this.
child = root->child_at(0); child = root->child_at(0);
WaitForChildFrameSurfaceReady(child->current_frame_host()); WaitForHitTestDataOrChildSurfaceReady(child->current_frame_host());
RenderWidgetHostViewChildFrame* child_view = RenderWidgetHostViewChildFrame* child_view =
static_cast<RenderWidgetHostViewChildFrame*>( static_cast<RenderWidgetHostViewChildFrame*>(
......
...@@ -79,6 +79,7 @@ ...@@ -79,6 +79,7 @@
#include "content/public/common/use_zoom_for_dsf_policy.h" #include "content/public/common/use_zoom_for_dsf_policy.h"
#include "content/public/test/browser_test_utils.h" #include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test_utils.h" #include "content/public/test/content_browser_test_utils.h"
#include "content/public/test/hit_test_region_observer.h"
#include "content/public/test/navigation_handle_observer.h" #include "content/public/test/navigation_handle_observer.h"
#include "content/public/test/test_frame_navigation_observer.h" #include "content/public/test/test_frame_navigation_observer.h"
#include "content/public/test/test_navigation_observer.h" #include "content/public/test/test_navigation_observer.h"
...@@ -1139,7 +1140,8 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, ViewBoundsInNestedFrameTest) { ...@@ -1139,7 +1140,8 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, ViewBoundsInNestedFrameTest) {
nested_iframe_node->current_frame_host() nested_iframe_node->current_frame_host()
->GetRenderWidgetHost() ->GetRenderWidgetHost()
->GetView()); ->GetView());
WaitForChildFrameSurfaceReady(nested_iframe_node->current_frame_host()); WaitForHitTestDataOrChildSurfaceReady(
nested_iframe_node->current_frame_host());
float scale_factor = GetPageScaleFactor(shell()); float scale_factor = GetPageScaleFactor(shell());
...@@ -1206,7 +1208,8 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, ...@@ -1206,7 +1208,8 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
(child_rwhv->wheel_scroll_latching_enabled() ? child_rwh : root_rwh), (child_rwhv->wheel_scroll_latching_enabled() ? child_rwh : root_rwh),
blink::WebInputEvent::kGestureFlingStart); blink::WebInputEvent::kGestureFlingStart);
WaitForChildFrameSurfaceReady(child_iframe_node->current_frame_host()); WaitForHitTestDataOrChildSurfaceReady(
child_iframe_node->current_frame_host());
gesture_fling_start_ack_observer.Reset(); gesture_fling_start_ack_observer.Reset();
...@@ -1315,7 +1318,8 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, ScrollBubblingFromOOPIFTest) { ...@@ -1315,7 +1318,8 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, ScrollBubblingFromOOPIFTest) {
->GetRenderWidgetHost() ->GetRenderWidgetHost()
->GetView()); ->GetView());
WaitForChildFrameSurfaceReady(nested_iframe_node->current_frame_host()); WaitForHitTestDataOrChildSurfaceReady(
nested_iframe_node->current_frame_host());
// Save the original offset as a point of reference. // Save the original offset as a point of reference.
filter->WaitForRect(); filter->WaitForRect();
...@@ -1506,7 +1510,8 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, ...@@ -1506,7 +1510,8 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
RenderWidgetHost* child_rwh = RenderWidgetHost* child_rwh =
child_iframe_node->current_frame_host()->GetRenderWidgetHost(); child_iframe_node->current_frame_host()->GetRenderWidgetHost();
WaitForChildFrameSurfaceReady(child_iframe_node->current_frame_host()); WaitForHitTestDataOrChildSurfaceReady(
child_iframe_node->current_frame_host());
GenerateTapDownGesture(child_rwh); GenerateTapDownGesture(child_rwh);
// Send a GSB to start scrolling sequence. // Send a GSB to start scrolling sequence.
...@@ -1657,7 +1662,8 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, ...@@ -1657,7 +1662,8 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
->GetRenderWidgetHost() ->GetRenderWidgetHost()
->GetView()); ->GetView());
WaitForChildFrameSurfaceReady(nested_iframe_node->current_frame_host()); WaitForHitTestDataOrChildSurfaceReady(
nested_iframe_node->current_frame_host());
InputEventAckWaiter ack_observer( InputEventAckWaiter ack_observer(
root->current_frame_host()->GetRenderWidgetHost(), root->current_frame_host()->GetRenderWidgetHost(),
...@@ -1743,7 +1749,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, ...@@ -1743,7 +1749,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
GURL url_domain_b( GURL url_domain_b(
embedded_test_server()->GetURL("b.com", "/body_overflow_hidden.html")); embedded_test_server()->GetURL("b.com", "/body_overflow_hidden.html"));
NavigateFrameToURL(iframe_node, url_domain_b); NavigateFrameToURL(iframe_node, url_domain_b);
WaitForChildFrameSurfaceReady(iframe_node->current_frame_host()); WaitForHitTestDataOrChildSurfaceReady(iframe_node->current_frame_host());
RenderWidgetHostViewBase* root_view = static_cast<RenderWidgetHostViewBase*>( RenderWidgetHostViewBase* root_view = static_cast<RenderWidgetHostViewBase*>(
root->current_frame_host()->GetRenderWidgetHost()->GetView()); root->current_frame_host()->GetRenderWidgetHost()->GetView());
...@@ -1823,7 +1829,8 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, ScrollLocalSubframeInOOPIF) { ...@@ -1823,7 +1829,8 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, ScrollLocalSubframeInOOPIF) {
->GetRenderWidgetHost() ->GetRenderWidgetHost()
->GetView()); ->GetView());
WaitForChildFrameSurfaceReady(parent_iframe_node->current_frame_host()); WaitForHitTestDataOrChildSurfaceReady(
parent_iframe_node->current_frame_host());
// When we scroll the inner frame, we should have the GSB be consumed. // When we scroll the inner frame, we should have the GSB be consumed.
// The outer iframe not being scrollable should not cause the GSB to go // The outer iframe not being scrollable should not cause the GSB to go
...@@ -11058,7 +11065,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, ...@@ -11058,7 +11065,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
DepictFrameTree(root)); DepictFrameTree(root));
FrameTreeNode* nested_child = root->child_at(0)->child_at(0); FrameTreeNode* nested_child = root->child_at(0)->child_at(0);
WaitForChildFrameSurfaceReady(nested_child->current_frame_host()); WaitForHitTestDataOrChildSurfaceReady(nested_child->current_frame_host());
EXPECT_TRUE( EXPECT_TRUE(
ExecuteScript(nested_child->current_frame_host(), "startTest();")); ExecuteScript(nested_child->current_frame_host(), "startTest();"));
......
#### WaitForChildFrameSurfaceReady #### WaitForChildFrameSurfaceReady
# WaitForChildFrameSurfaceReady doesn't work http://crbug.com/763452 # WaitForChildFrameSurfaceReady doesn't work http://crbug.com/763452
-PointerLockBrowserTest.*
-SitePerProcessGestureHitTestBrowserTest.* -SitePerProcessGestureHitTestBrowserTest.*
-SitePerProcessHighDPIHitTestBrowserTest.* -SitePerProcessHighDPIHitTestBrowserTest.*
-SitePerProcessInternalsHitTestBrowserTest.* -SitePerProcessInternalsHitTestBrowserTest.*
-SitePerProcessMouseWheelHitTestBrowserTest.* -SitePerProcessMouseWheelHitTestBrowserTest.*
-TouchSelectionForCrossProcessFramesTests/TouchSelectionControllerClientAuraSiteIsolationTest.*
# Further WaitForChildFrameSurfaceReady doesn't work http://crbug.com/787945 # Further WaitForChildFrameSurfaceReady doesn't work http://crbug.com/787945
-SitePerProcessBrowserTest.GestureFlingStartEventsBubble
-SitePerProcessBrowserTest.OOPIFDetachDuringAnimation
-SitePerProcessBrowserTest.ScrollBubblingFromNestedOOPIFTest
-SitePerProcessBrowserTest.ScrollBubblingFromOOPIFTest
-SitePerProcessBrowserTest.ScrollBubblingFromOOPIFWithBodyOverflowHidden
-SitePerProcessBrowserTest.ScrollLocalSubframeInOOPIF
-SitePerProcessBrowserTest.TouchscreenGestureFlingStart
-SitePerProcessBrowserTest.ViewBoundsInNestedFrameTest
-SitePerProcessBrowserTouchActionTest.EffectiveTouchActionPropagatesAcrossFrames -SitePerProcessBrowserTouchActionTest.EffectiveTouchActionPropagatesAcrossFrames
-SitePerProcessBrowserTouchActionTest.EffectiveTouchActionPropagatesAcrossNestedFrames -SitePerProcessBrowserTouchActionTest.EffectiveTouchActionPropagatesAcrossNestedFrames
-SitePerProcessBrowserTouchActionTest.EffectiveTouchActionPropagatesWhenChildFrameNavigates -SitePerProcessBrowserTouchActionTest.EffectiveTouchActionPropagatesWhenChildFrameNavigates
...@@ -49,6 +39,10 @@ ...@@ -49,6 +39,10 @@
-SitePerProcessNonIntegerScaleFactorHitTestBrowserTest.NestedSurfaceHitTestTest* -SitePerProcessNonIntegerScaleFactorHitTestBrowserTest.NestedSurfaceHitTestTest*
-SitePerProcessMouseWheelHitTestBrowserTestWheelScrollLatchingDisabled* -SitePerProcessMouseWheelHitTestBrowserTestWheelScrollLatchingDisabled*
# SynchronizeVisualPropertiesMessageFilter::WaitForRect() times out.
# https://crbug.com/848825
-SitePerProcessBrowserTest.ViewBoundsInNestedFrameTest
#### Hit Testing #### Hit Testing
# Flaky Result on Windows-7 http://crbug.com/883463 # Flaky Result on Windows-7 http://crbug.com/883463
-MainThreadEventQueueBrowserTest.MouseMove -MainThreadEventQueueBrowserTest.MouseMove
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment