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

Unified Diff: content/browser/site_per_process_browsertest.cc

Issue 2951053005: Add Mojo API for Blink hit testing (Closed)
Patch Set: Address Rob's comments Created 3 years, 4 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/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 cec49d10b14e21cb81a0770112e4e706217ae3ee..5cfd6de398def4df44680fe8499e8f3283bd130e 100644
--- a/content/browser/site_per_process_browsertest.cc
+++ b/content/browser/site_per_process_browsertest.cc
@@ -273,6 +273,14 @@ double GetPageScaleFactor(Shell* shell) {
.page_scale_factor;
}
+bool callback_received = false;
+int received_frame_id = -2;
+
+void callback(int frame_id) {
+ received_frame_id = frame_id;
+ callback_received = true;
+}
+
// Helper function that performs a surface hittest.
void SurfaceHitTestTestHelper(
Shell* shell,
@@ -330,6 +338,18 @@ void SurfaceHitTestTestHelper(
child_event.click_count = 1;
main_frame_monitor.ResetEventReceived();
child_frame_monitor.ResetEventReceived();
+
+ callback_received = false;
+ root->current_frame_host()->GetFrameInputHandler()->HitTestFrameAt(
+ (gfx::PointF)child_event.PositionInWidget(), base::Bind(&callback));
+ while (!callback_received) {
+ base::RunLoop run_loop;
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, run_loop.QuitClosure(), TestTimeouts::tiny_timeout());
+ run_loop.Run();
+ }
+ ASSERT_EQ(4, received_frame_id);
+
router->RouteMouseEvent(root_view, &child_event, ui::LatencyInfo());
EXPECT_TRUE(child_frame_monitor.EventWasReceived());
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_base.h ('k') | content/common/frame_sink_provider.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698