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

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

Issue 1534933002: Don't process messages sent to dead routing ids. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More unittest fixes. 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/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 ac3cb9467f230606e015df5f1c0cbe94e6990f5f..5178d8c41102e54b3b8eb6aa069ed5a79a991640 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
@@ -150,7 +150,9 @@ class MockRenderWidgetHostImpl : public RenderWidgetHostImpl {
MockRenderWidgetHostImpl(RenderWidgetHostDelegate* delegate,
RenderProcessHost* process,
int32_t routing_id)
- : RenderWidgetHostImpl(delegate, process, routing_id, false) {}
+ : RenderWidgetHostImpl(delegate, process, routing_id, false) {
+ set_renderer_initialized(true);
+ }
MOCK_METHOD0(Focus, void());
MOCK_METHOD0(Blur, void());
@@ -754,6 +756,7 @@ TEST_F(RenderWidgetHostViewMacTest, BlurAndFocusOnSetActive) {
TestBrowserContext browser_context;
MockRenderProcessHost* process_host =
new MockRenderProcessHost(&browser_context);
+ process_host->Init();
// Owned by its |cocoa_view()|.
int32_t routing_id = process_host->GetNextRoutingID();
@@ -808,6 +811,7 @@ TEST_F(RenderWidgetHostViewMacTest, ScrollWheelEndEventDelivery) {
MockRenderWidgetHostImpl* host =
new MockRenderWidgetHostImpl(&delegate, process_host, routing_id);
RenderWidgetHostViewMac* view = new RenderWidgetHostViewMac(host, false);
+ process_host->sink().ClearMessages();
// Send an initial wheel event with NSEventPhaseBegan to the view.
NSEvent* event1 = MockScrollWheelEventWithPhase(@selector(phaseBegan), 0);
@@ -849,6 +853,7 @@ TEST_F(RenderWidgetHostViewMacTest, IgnoreEmptyUnhandledWheelEvent) {
MockRenderWidgetHostImpl* host =
new MockRenderWidgetHostImpl(&delegate, process_host, routing_id);
RenderWidgetHostViewMac* view = new RenderWidgetHostViewMac(host, false);
+ process_host->sink().ClearMessages();
// Add a delegate to the view.
base::scoped_nsobject<MockRenderWidgetHostViewMacDelegate> view_delegate(
@@ -896,6 +901,7 @@ TEST_F(RenderWidgetHostViewMacTest, GuestViewDoesNotLeak) {
TestBrowserContext browser_context;
MockRenderProcessHost* process_host =
new MockRenderProcessHost(&browser_context);
+ process_host->Init();
int32_t routing_id = process_host->GetNextRoutingID();
// Owned by its |cocoa_view()|.
@@ -938,6 +944,7 @@ TEST_F(RenderWidgetHostViewMacTest, Background) {
TestBrowserContext browser_context;
MockRenderProcessHost* process_host =
new MockRenderProcessHost(&browser_context);
+ process_host->Init();
MockRenderWidgetHostDelegate delegate;
int32_t routing_id = process_host->GetNextRoutingID();
MockRenderWidgetHostImpl* host =
@@ -1020,6 +1027,7 @@ TEST_F(RenderWidgetHostViewMacPinchTest, PinchThresholding) {
MockRenderWidgetHostImpl* host =
new MockRenderWidgetHostImpl(&delegate, process_host_, routing_id);
RenderWidgetHostViewMac* view = new RenderWidgetHostViewMac(host, false);
+ process_host_->sink().ClearMessages();
// We'll use this IPC message to ack events.
InputEventAck ack(blink::WebInputEvent::GesturePinchUpdate,
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.cc ('k') | content/browser/web_contents/web_contents_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698