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

Unified Diff: content/test/content_browser_test_utils_internal.cc

Issue 1743303002: Make browser hit testing return correct SurfaceId with nested Surfaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits addressed Created 4 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
Index: content/test/content_browser_test_utils_internal.cc
diff --git a/content/test/content_browser_test_utils_internal.cc b/content/test/content_browser_test_utils_internal.cc
index af3d347c80efbfccaef074b09ebab1db12a933d8..dad702ccd709105ec0488d78f59470ddc7e75abd 100644
--- a/content/test/content_browser_test_utils_internal.cc
+++ b/content/test/content_browser_test_utils_internal.cc
@@ -281,7 +281,7 @@ void SurfaceHitTestReadyNotifier::WaitForSurfaceReady() {
root_surface_id_ = target_view_->FrameConnectorForTesting()
->GetRootRenderWidgetHostViewForTesting()
->SurfaceIdForTesting();
- if (ContainsSurfaceId())
+ if (ContainsSurfaceId(root_surface_id_))
return;
while (true) {
@@ -294,17 +294,19 @@ void SurfaceHitTestReadyNotifier::WaitForSurfaceReady() {
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE, run_loop.QuitClosure(), TestTimeouts::tiny_timeout());
run_loop.Run();
- if (ContainsSurfaceId())
+ if (ContainsSurfaceId(root_surface_id_))
break;
}
}
-bool SurfaceHitTestReadyNotifier::ContainsSurfaceId() {
- if (root_surface_id_.is_null())
+bool SurfaceHitTestReadyNotifier::ContainsSurfaceId(
+ cc::SurfaceId container_surface_id) {
+ if (container_surface_id.is_null())
return false;
- for (cc::SurfaceId id : surface_manager_->GetSurfaceForId(root_surface_id_)
- ->referenced_surfaces()) {
- if (id == target_view_->SurfaceIdForTesting())
+ for (cc::SurfaceId id :
+ surface_manager_->GetSurfaceForId(container_surface_id)
+ ->referenced_surfaces()) {
+ if (id == target_view_->SurfaceIdForTesting() || ContainsSurfaceId(id))
return true;
}
return false;

Powered by Google App Engine
This is Rietveld 408576698