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

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

Issue 2404473002: Build fix for #675 (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | 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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 widget()->SendInputEvent(touch); 367 widget()->SendInputEvent(touch);
368 histogram_tester().ExpectTotalCount("Event.Touch.TouchLatencyOutsideFling", 368 histogram_tester().ExpectTotalCount("Event.Touch.TouchLatencyOutsideFling",
369 2); 369 2);
370 } 370 }
371 371
372 class PopupRenderWidget : public RenderWidget { 372 class PopupRenderWidget : public RenderWidget {
373 public: 373 public:
374 explicit PopupRenderWidget(CompositorDependencies* compositor_deps) 374 explicit PopupRenderWidget(CompositorDependencies* compositor_deps)
375 : RenderWidget(compositor_deps, 375 : RenderWidget(compositor_deps,
376 blink::WebPopupTypePage, 376 blink::WebPopupTypePage,
377 ScreenInfo(), 377 blink::WebScreenInfo(),
378 false, 378 false,
379 false, 379 false,
380 false) { 380 false) {
381 webwidget_internal_ = &mock_webwidget_; 381 webwidget_ = &mock_webwidget_;
382 // A RenderWidget is not fully initialized until it has a routing ID. 382 // A RenderWidget is not fully initialized until it has a routing ID.
383 SetRoutingID(1); 383 SetRoutingID(1);
384 did_show_ = true; 384 did_show_ = true;
385 } 385 }
386 386
387 IPC::TestSink* sink() { return &sink_; } 387 IPC::TestSink* sink() { return &sink_; }
388 388
389 MockWebWidget* mock_webwidget() { return &mock_webwidget_; } 389 MockWebWidget* mock_webwidget() { return &mock_webwidget_; }
390 390
391 void SetScreenMetricsEmulationParameters( 391 void SetScreenMetricsEmulationParameters(
392 bool, 392 bool,
393 const blink::WebDeviceEmulationParams&) override {} 393 const blink::WebDeviceEmulationParams&) override {}
394 394
395 protected: 395 protected:
396 ~PopupRenderWidget() override { webwidget_internal_ = nullptr; } 396 ~PopupRenderWidget() override { webwidget_ = nullptr; }
397 397
398 bool Send(IPC::Message* msg) override { 398 bool Send(IPC::Message* msg) override {
399 sink_.OnMessageReceived(*msg); 399 sink_.OnMessageReceived(*msg);
400 delete msg; 400 delete msg;
401 return true; 401 return true;
402 } 402 }
403 403
404 private: 404 private:
405 IPC::TestSink sink_; 405 IPC::TestSink sink_;
406 MockWebWidget mock_webwidget_; 406 MockWebWidget mock_webwidget_;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 blink::WebRect popup_emulated_rect(130, 170, 100, 400); 488 blink::WebRect popup_emulated_rect(130, 170, 100, 400);
489 widget()->setWindowRect(popup_emulated_rect); 489 widget()->setWindowRect(popup_emulated_rect);
490 490
491 EXPECT_EQ(popup_emulated_rect.x, widget()->windowRect().x); 491 EXPECT_EQ(popup_emulated_rect.x, widget()->windowRect().x);
492 EXPECT_EQ(popup_emulated_rect.y, widget()->windowRect().y); 492 EXPECT_EQ(popup_emulated_rect.y, widget()->windowRect().y);
493 EXPECT_EQ(popup_emulated_rect.x, widget()->viewRect().x); 493 EXPECT_EQ(popup_emulated_rect.x, widget()->viewRect().x);
494 EXPECT_EQ(popup_emulated_rect.y, widget()->viewRect().y); 494 EXPECT_EQ(popup_emulated_rect.y, widget()->viewRect().y);
495 } 495 }
496 496
497 } // namespace content 497 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698