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

Unified Diff: content/test/content_browser_test_utils_internal.h

Issue 1734403003: Add helper class for tests using browser process hit testing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix gcc compile warnings 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.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_
« no previous file with comments | « content/browser/site_per_process_browsertest.cc ('k') | content/test/content_browser_test_utils_internal.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698