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

Side by Side Diff: content/renderer/render_widget_unittest.cc

Issue 2483593002: RenderWidget: hoist synchronous IPC out of Init methods. (Closed)
Patch Set: Handle IPC failure Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « content/renderer/render_widget_fullscreen.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_widget.h" 5 #include "content/renderer/render_widget.h"
6 6
7 #include <tuple> 7 #include <tuple>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 public: 54 public:
55 explicit InteractiveRenderWidget(CompositorDependencies* compositor_deps) 55 explicit InteractiveRenderWidget(CompositorDependencies* compositor_deps)
56 : RenderWidget(compositor_deps, 56 : RenderWidget(compositor_deps,
57 blink::WebPopupTypeNone, 57 blink::WebPopupTypeNone,
58 ScreenInfo(), 58 ScreenInfo(),
59 false, 59 false,
60 false, 60 false,
61 false), 61 false),
62 always_overscroll_(false) { 62 always_overscroll_(false) {
63 webwidget_internal_ = &mock_webwidget_; 63 webwidget_internal_ = &mock_webwidget_;
64 // A RenderWidget is not fully initialized until it has a routing ID. 64 InitRoutingID(++next_routing_id_);
65 SetRoutingID(++next_routing_id_);
66 } 65 }
67 66
68 void SetTouchRegion(const std::vector<gfx::Rect>& rects) { 67 void SetTouchRegion(const std::vector<gfx::Rect>& rects) {
69 rects_ = rects; 68 rects_ = rects;
70 } 69 }
71 70
72 void SendInputEvent(const blink::WebInputEvent& event) { 71 void SendInputEvent(const blink::WebInputEvent& event) {
73 OnHandleInputEvent( 72 OnHandleInputEvent(
74 &event, ui::LatencyInfo(), 73 &event, ui::LatencyInfo(),
75 ui::WebInputEventTraits::ShouldBlockEventStream(event) 74 ui::WebInputEventTraits::ShouldBlockEventStream(event)
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 class PopupRenderWidget : public RenderWidget { 371 class PopupRenderWidget : public RenderWidget {
373 public: 372 public:
374 explicit PopupRenderWidget(CompositorDependencies* compositor_deps) 373 explicit PopupRenderWidget(CompositorDependencies* compositor_deps)
375 : RenderWidget(compositor_deps, 374 : RenderWidget(compositor_deps,
376 blink::WebPopupTypePage, 375 blink::WebPopupTypePage,
377 ScreenInfo(), 376 ScreenInfo(),
378 false, 377 false,
379 false, 378 false,
380 false) { 379 false) {
381 webwidget_internal_ = &mock_webwidget_; 380 webwidget_internal_ = &mock_webwidget_;
382 // A RenderWidget is not fully initialized until it has a routing ID. 381 InitRoutingID(1);
383 SetRoutingID(1);
384 did_show_ = true; 382 did_show_ = true;
385 } 383 }
386 384
387 IPC::TestSink* sink() { return &sink_; } 385 IPC::TestSink* sink() { return &sink_; }
388 386
389 MockWebWidget* mock_webwidget() { return &mock_webwidget_; } 387 MockWebWidget* mock_webwidget() { return &mock_webwidget_; }
390 388
391 void SetScreenMetricsEmulationParameters( 389 void SetScreenMetricsEmulationParameters(
392 bool, 390 bool,
393 const blink::WebDeviceEmulationParams&) override {} 391 const blink::WebDeviceEmulationParams&) override {}
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 blink::WebRect popup_emulated_rect(130, 170, 100, 400); 486 blink::WebRect popup_emulated_rect(130, 170, 100, 400);
489 widget()->setWindowRect(popup_emulated_rect); 487 widget()->setWindowRect(popup_emulated_rect);
490 488
491 EXPECT_EQ(popup_emulated_rect.x, widget()->windowRect().x); 489 EXPECT_EQ(popup_emulated_rect.x, widget()->windowRect().x);
492 EXPECT_EQ(popup_emulated_rect.y, widget()->windowRect().y); 490 EXPECT_EQ(popup_emulated_rect.y, widget()->windowRect().y);
493 EXPECT_EQ(popup_emulated_rect.x, widget()->viewRect().x); 491 EXPECT_EQ(popup_emulated_rect.x, widget()->viewRect().x);
494 EXPECT_EQ(popup_emulated_rect.y, widget()->viewRect().y); 492 EXPECT_EQ(popup_emulated_rect.y, widget()->viewRect().y);
495 } 493 }
496 494
497 } // namespace content 495 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_widget_fullscreen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698