Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Unified Diff: content/browser/site_per_process_browsertest.cc

Issue 2686683004: ABANDONED CL: WaitForChildFrameSurfaceReady to avoid flaky test hangs. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/renderer_host/input/input_router_impl.cc ('k') | content/public/test/browser_test_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/site_per_process_browsertest.cc
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc
index 4f2eacedf5199d3f835a4de3016578cbabe52404..20b08aabb990d253ab9b7fca1bb4b5875570f241 100644
--- a/content/browser/site_per_process_browsertest.cc
+++ b/content/browser/site_per_process_browsertest.cc
@@ -257,12 +257,7 @@ void SurfaceHitTestTestHelper(
RenderWidgetHostViewBase* root_view = static_cast<RenderWidgetHostViewBase*>(
root->current_frame_host()->GetRenderWidgetHost()->GetView());
- RenderWidgetHostViewBase* rwhv_child = static_cast<RenderWidgetHostViewBase*>(
- child_node->current_frame_host()->GetRenderWidgetHost()->GetView());
-
- SurfaceHitTestReadyNotifier notifier(
- static_cast<RenderWidgetHostViewChildFrame*>(rwhv_child));
- notifier.WaitForSurfaceReady();
+ WaitForChildFrameSurfaceReady(child_node->current_frame_host());
// Target input event to child frame.
blink::WebMouseEvent child_event(blink::WebInputEvent::MouseDown,
@@ -996,9 +991,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
->GetRenderWidgetHost()
->GetView());
- SurfaceHitTestReadyNotifier notifier(
- static_cast<RenderWidgetHostViewChildFrame*>(rwhv_nested));
- notifier.WaitForSurfaceReady();
+ WaitForChildFrameSurfaceReady(nested_iframe_node->current_frame_host());
// Verify the view bounds of the nested iframe, which should account for the
// relative offset of its direct parent within the root frame.
@@ -1089,9 +1082,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
->GetRenderWidgetHost()
->GetView());
- SurfaceHitTestReadyNotifier notifier(
- static_cast<RenderWidgetHostViewChildFrame*>(rwhv_nested));
- notifier.WaitForSurfaceReady();
+ WaitForChildFrameSurfaceReady(nested_iframe_node->current_frame_host());
// Save the original offset as a point of reference.
filter->Wait();
@@ -1229,12 +1220,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, MAYBE_ScrollEventToOOPIF) {
static_cast<RenderWidgetHostViewAura*>(
root->current_frame_host()->GetRenderWidgetHost()->GetView());
- RenderWidgetHostViewBase* rwhv_child = static_cast<RenderWidgetHostViewBase*>(
- child_node->current_frame_host()->GetRenderWidgetHost()->GetView());
-
- SurfaceHitTestReadyNotifier notifier(
- static_cast<RenderWidgetHostViewChildFrame*>(rwhv_child));
- notifier.WaitForSurfaceReady();
+ WaitForChildFrameSurfaceReady(child_node->current_frame_host());
// Create listener for input events.
TestInputEventObserver child_frame_monitor(
@@ -1328,15 +1314,8 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
RenderWidgetHostViewBase* root_view = static_cast<RenderWidgetHostViewBase*>(
root->current_frame_host()->GetRenderWidgetHost()->GetView());
- RenderWidgetHostViewBase* rwhv_nested =
- static_cast<RenderWidgetHostViewBase*>(
- nested_iframe_node->current_frame_host()
- ->GetRenderWidgetHost()
- ->GetView());
- SurfaceHitTestReadyNotifier notifier(
- static_cast<RenderWidgetHostViewChildFrame*>(rwhv_nested));
- notifier.WaitForSurfaceReady();
+ WaitForChildFrameSurfaceReady(nested_iframe_node->current_frame_host());
// Target input event to nested frame.
blink::WebMouseEvent nested_event(blink::WebInputEvent::MouseDown,
@@ -1393,12 +1372,8 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
RenderWidgetHostViewBase* root_view = static_cast<RenderWidgetHostViewBase*>(
root->current_frame_host()->GetRenderWidgetHost()->GetView());
- RenderWidgetHostViewBase* rwhv_child = static_cast<RenderWidgetHostViewBase*>(
- child_node->current_frame_host()->GetRenderWidgetHost()->GetView());
- SurfaceHitTestReadyNotifier notifier(
- static_cast<RenderWidgetHostViewChildFrame*>(rwhv_child));
- notifier.WaitForSurfaceReady();
+ WaitForChildFrameSurfaceReady(child_node->current_frame_host());
// Target input event to child frame.
blink::WebMouseEvent child_event(blink::WebInputEvent::MouseDown,
@@ -1456,19 +1431,11 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
RenderWidgetHostViewBase* rwhv_a = static_cast<RenderWidgetHostViewBase*>(
root->current_frame_host()->GetRenderWidgetHost()->GetView());
- RenderWidgetHostViewBase* rwhv_b = static_cast<RenderWidgetHostViewBase*>(
- b_node->current_frame_host()->GetRenderWidgetHost()->GetView());
- RenderWidgetHostViewBase* rwhv_d = static_cast<RenderWidgetHostViewBase*>(
- d_node->current_frame_host()->GetRenderWidgetHost()->GetView());
// Verifying surfaces are ready in B and D are sufficient, since other
// surfaces contain at least one of them.
- SurfaceHitTestReadyNotifier notifier_b(
- static_cast<RenderWidgetHostViewChildFrame*>(rwhv_b));
- notifier_b.WaitForSurfaceReady();
- SurfaceHitTestReadyNotifier notifier_d(
- static_cast<RenderWidgetHostViewChildFrame*>(rwhv_d));
- notifier_d.WaitForSurfaceReady();
+ WaitForChildFrameSurfaceReady(b_node->current_frame_host());
+ WaitForChildFrameSurfaceReady(d_node->current_frame_host());
// Create listeners for mouse events. These are used to verify that the
// RenderWidgetHostInputEventRouter is generating MouseLeave, etc for
@@ -1570,12 +1537,8 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
RenderWidgetHostViewBase* root_view = static_cast<RenderWidgetHostViewBase*>(
root->current_frame_host()->GetRenderWidgetHost()->GetView());
- RenderWidgetHostViewBase* rwhv_child = static_cast<RenderWidgetHostViewBase*>(
- child_node->current_frame_host()->GetRenderWidgetHost()->GetView());
- SurfaceHitTestReadyNotifier notifier(
- static_cast<RenderWidgetHostViewChildFrame*>(rwhv_child));
- notifier.WaitForSurfaceReady();
+ WaitForChildFrameSurfaceReady(child_node->current_frame_host());
// Target MouseDown to child frame.
blink::WebMouseEvent mouse_event(blink::WebInputEvent::MouseDown,
@@ -5391,11 +5354,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
// Synchronize with the child and parent renderers to guarantee that the
// surface information required for event hit testing is ready.
- RenderWidgetHostViewBase* child_rwhv = static_cast<RenderWidgetHostViewBase*>(
- root->child_at(0)->current_frame_host()->GetView());
- SurfaceHitTestReadyNotifier notifier(
- static_cast<RenderWidgetHostViewChildFrame*>(child_rwhv));
- notifier.WaitForSurfaceReady();
+ WaitForChildFrameSurfaceReady(root->child_at(0)->current_frame_host());
// There's no intrinsic reason the following values can't be equal, but they
// aren't at present, and if they become the same this test will need to be
@@ -5545,11 +5504,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
// Synchronize with the child and parent renderers to guarantee that the
// surface information required for event hit testing is ready.
- RenderWidgetHostViewBase* child_rwhv = static_cast<RenderWidgetHostViewBase*>(
- child_frame_host->GetView());
- SurfaceHitTestReadyNotifier notifier(
- static_cast<RenderWidgetHostViewChildFrame*>(child_rwhv));
- notifier.WaitForSurfaceReady();
+ WaitForChildFrameSurfaceReady(child_frame_host);
// There have been no GestureTaps sent yet.
{
@@ -5745,9 +5700,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
// surface information required for event hit testing is ready.
auto* rwhv_child =
static_cast<RenderWidgetHostViewBase*>(child_frame_host->GetView());
- SurfaceHitTestReadyNotifier notifier(
- static_cast<RenderWidgetHostViewChildFrame*>(rwhv_child));
- notifier.WaitForSurfaceReady();
+ WaitForChildFrameSurfaceReady(child_frame_host);
// All touches & gestures are sent to the main frame's view, and should be
// routed appropriately from there.
@@ -5827,9 +5780,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
// surface information required for event hit testing is ready.
auto* rwhv_child =
static_cast<RenderWidgetHostViewBase*>(child_frame_host->GetView());
- SurfaceHitTestReadyNotifier notifier(
- static_cast<RenderWidgetHostViewChildFrame*>(rwhv_child));
- notifier.WaitForSurfaceReady();
+ WaitForChildFrameSurfaceReady(child_frame_host);
// All touches & gestures are sent to the main frame's view, and should be
// routed appropriately from there.
@@ -5935,15 +5886,11 @@ void CreateContextMenuTestHelper(
RenderWidgetHostViewBase* root_view = static_cast<RenderWidgetHostViewBase*>(
root->current_frame_host()->GetRenderWidgetHost()->GetView());
- RenderWidgetHostViewBase* rwhv_child = static_cast<RenderWidgetHostViewBase*>(
- child_node->current_frame_host()->GetRenderWidgetHost()->GetView());
// Ensure that the child process renderer is ready to have input events
// routed to it. This happens when the browser process has received
// updated compositor surfaces from both renderer processes.
- SurfaceHitTestReadyNotifier notifier(
- static_cast<RenderWidgetHostViewChildFrame*>(rwhv_child));
- notifier.WaitForSurfaceReady();
+ WaitForChildFrameSurfaceReady(child_node->current_frame_host());
// A WebContentsDelegate to listen for the ShowContextMenu message.
ContextMenuObserverDelegate context_menu_delegate;
@@ -8107,9 +8054,7 @@ class SitePerProcessGestureBrowserTest : public SitePerProcessBrowserTest {
rwhva_root_ = static_cast<RenderWidgetHostViewAura*>(
shell()->web_contents()->GetRenderWidgetHostView());
- SurfaceHitTestReadyNotifier notifier(
- static_cast<RenderWidgetHostViewChildFrame*>(rwhv_child_));
- notifier.WaitForSurfaceReady();
+ WaitForChildFrameSurfaceReady(child_node->current_frame_host());
rwhi_child_ = child_node->current_frame_host()->GetRenderWidgetHost();
rwhi_root_ = root_node->current_frame_host()->GetRenderWidgetHost();
« no previous file with comments | « content/browser/renderer_host/input/input_router_impl.cc ('k') | content/public/test/browser_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698