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

Unified Diff: content/browser/site_per_process_browsertest.cc

Issue 1416173002: Fix flaky SitePerProcessBrowserTest.SurfaceHitTestTest test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressing comments Created 5 years, 2 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 | « no previous file | no next file » | 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 012b9156a7164a1af7cc034eb4718d5cb55ba329..e52ca9f14cb3aa086b460a58653950b058549874 100644
--- a/content/browser/site_per_process_browsertest.cc
+++ b/content/browser/site_per_process_browsertest.cc
@@ -476,11 +476,9 @@ class RenderWidgetHostMouseEventMonitor {
// Test that mouse events are being routed to the correct RenderWidgetHostView
// based on coordinates.
-#if defined(OS_ANDROID) || defined(THREAD_SANITIZER) || defined(OS_LINUX)
+#if defined(OS_ANDROID)
// Browser process hit testing is not implemented on Android.
// https://crbug.com/491334
-// Test fails under TSAN, see https://crbug.com/527618
-// Test is flaky under Linux, see https://crbug.com/528189
#define MAYBE_SurfaceHitTestTest DISABLED_SurfaceHitTestTest
#else
#define MAYBE_SurfaceHitTestTest SurfaceHitTestTest
@@ -541,10 +539,11 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, MAYBE_SurfaceHitTestTest) {
child_event.x = 75;
child_event.y = 75;
child_event.clickCount = 1;
+ main_frame_monitor.ResetEventReceived();
+ child_frame_monitor.ResetEventReceived();
router->RouteMouseEvent(root_view, &child_event);
- if (!child_frame_monitor.EventWasReceived()) {
- main_frame_monitor.ResetEventReceived();
+ while (!child_frame_monitor.EventWasReceived()) {
// This is working around a big synchronization problem. It is very
// difficult to know if we have received a compositor frame from the
// main frame renderer *after* it received the child frame's surface
@@ -559,6 +558,14 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, MAYBE_SurfaceHitTestTest) {
base::TimeDelta::FromMilliseconds(10));
run_loop.Run();
}
+ cur_render_frame_number = root_view->RendererFrameNumber();
+ child_event.type = blink::WebInputEvent::MouseDown;
+ child_event.button = blink::WebPointerProperties::ButtonLeft;
+ child_event.x = 75;
+ child_event.y = 75;
+ child_event.clickCount = 1;
+ main_frame_monitor.ResetEventReceived();
+ child_frame_monitor.ResetEventReceived();
router->RouteMouseEvent(root_view, &child_event);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698