Index: content/test/content_browser_test_utils_internal.h |
diff --git a/content/test/content_browser_test_utils_internal.h b/content/test/content_browser_test_utils_internal.h |
index 22e9531bcf00250ea1766fbc20a9889ff2b631ee..12e7f8444234a66914a183a175a537a9b714190f 100644 |
--- a/content/test/content_browser_test_utils_internal.h |
+++ b/content/test/content_browser_test_utils_internal.h |
@@ -14,12 +14,18 @@ |
#include <vector> |
#include "base/macros.h" |
+#include "cc/surfaces/surface_id.h" |
#include "content/public/browser/resource_dispatcher_host_delegate.h" |
#include "url/gurl.h" |
+namespace cc { |
+class SurfaceManager; |
+} |
+ |
namespace content { |
class FrameTreeNode; |
+class RenderWidgetHostViewChildFrame; |
class Shell; |
class SiteInstance; |
class ToRenderFrameHost; |
@@ -97,6 +103,27 @@ class NavigationStallDelegate : public ResourceDispatcherHostDelegate { |
GURL url_; |
}; |
+// Helper class to assist with hit testing surfaces in multiple processes. |
+// WaitForSurfaceReady() will only return after a Surface from |target_view| |
+// has been composited in the top-level frame's Surface. At that point, |
+// browser process hit testing to target_view's Surface can succeed. |
+class SurfaceHitTestReadyNotifier { |
+ public: |
+ SurfaceHitTestReadyNotifier(RenderWidgetHostViewChildFrame* target_view); |
+ ~SurfaceHitTestReadyNotifier() {} |
+ |
+ void WaitForSurfaceReady(); |
+ |
+ private: |
+ bool ContainsSurfaceId(); |
+ |
+ cc::SurfaceManager* surface_manager_; |
+ cc::SurfaceId root_surface_id_; |
+ RenderWidgetHostViewChildFrame* target_view_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(SurfaceHitTestReadyNotifier); |
+}; |
+ |
} // namespace content |
#endif // CONTENT_TEST_CONTENT_BROWSER_TEST_UTILS_INTERNAL_H_ |