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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac_unittest.mm

Issue 2451953004: Fix mac raciness with initial needs begin frame state (Closed)
Patch Set: Fixes for ScrollWheelEndEventDelivery test Created 4 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 | « content/browser/renderer_host/render_widget_host_view_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
diff --git a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
index 6a7ec206fe87fd0bda82112cbe0c2ca8bd9cb3ee..e08e33974e2a658132ea310202f8630514bbfb22 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
@@ -949,6 +949,10 @@ TEST_F(RenderWidgetHostViewMacTest, ScrollWheelEndEventDelivery) {
[view->cocoa_view() scrollWheel:event1];
ASSERT_EQ(1U, process_host->sink().message_count());
+ // Flush and clear other messages (e.g. begin frames) the RWHVMac also sends.
+ base::RunLoop().RunUntilIdle();
+ process_host->sink().ClearMessages();
+
// Send an ACK for the first wheel event, so that the queue will be flushed.
InputEventAck ack(blink::WebInputEvent::MouseWheel,
INPUT_EVENT_ACK_STATE_CONSUMED);
@@ -961,7 +965,7 @@ TEST_F(RenderWidgetHostViewMacTest, ScrollWheelEndEventDelivery) {
NSEvent* event2 = MockScrollWheelEventWithPhase(@selector(phaseEnded), 0);
[NSApp postEvent:event2 atStart:NO];
base::RunLoop().RunUntilIdle();
- ASSERT_EQ(2U, process_host->sink().message_count());
+ ASSERT_EQ(1U, process_host->sink().message_count());
// Clean up.
host->ShutdownAndDestroyWidget(true);
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698