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

Unified Diff: content/test/test_render_view_host.cc

Issue 2861533003: Backfill some UI tests. (Closed)
Patch Set: test rwhv makes its own window Created 3 years, 7 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/test/test_render_view_host.h ('k') | ui/views/window/dialog_client_view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/test_render_view_host.cc
diff --git a/content/test/test_render_view_host.cc b/content/test/test_render_view_host.cc
index ece1a637fb4177cc712b0a947f755e58d90785ca..61596eb5883e3263a9b94d542427b3bf1708612e 100644
--- a/content/test/test_render_view_host.cc
+++ b/content/test/test_render_view_host.cc
@@ -30,6 +30,7 @@
#include "media/base/video_frame.h"
#include "ui/aura/env.h"
#include "ui/compositor/compositor.h"
+#include "ui/compositor/layer_type.h"
#include "ui/gfx/geometry/rect.h"
namespace content {
@@ -60,7 +61,8 @@ TestRenderWidgetHostView::TestRenderWidgetHostView(RenderWidgetHost* rwh)
is_showing_(false),
is_occluded_(false),
did_swap_compositor_frame_(false),
- background_color_(SK_ColorWHITE) {
+ background_color_(SK_ColorWHITE),
+ window_(new aura::Window(this)) {
sky 2017/05/10 15:49:50 Call window_->set_owned_by_parent(false). That way
Bret 2017/05/10 21:18:39 All done.
#if defined(OS_ANDROID)
frame_sink_id_ = AllocateFrameSinkId();
GetSurfaceManager()->RegisterFrameSinkId(frame_sink_id_);
@@ -73,6 +75,7 @@ TestRenderWidgetHostView::TestRenderWidgetHostView(RenderWidgetHost* rwh)
#endif
rwh_->SetView(this);
+ window_->Init(ui::LayerType::LAYER_NOT_DRAWN);
}
TestRenderWidgetHostView::~TestRenderWidgetHostView() {
@@ -80,6 +83,7 @@ TestRenderWidgetHostView::~TestRenderWidgetHostView() {
if (manager) {
manager->InvalidateFrameSinkId(frame_sink_id_);
}
+ delete window_;
}
RenderWidgetHost* TestRenderWidgetHostView::GetRenderWidgetHost() const {
@@ -91,7 +95,7 @@ gfx::Vector2dF TestRenderWidgetHostView::GetLastScrollOffset() const {
}
gfx::NativeView TestRenderWidgetHostView::GetNativeView() const {
- return nullptr;
+ return window_;
}
gfx::NativeViewAccessible TestRenderWidgetHostView::GetNativeViewAccessible() {
@@ -203,6 +207,39 @@ cc::FrameSinkId TestRenderWidgetHostView::GetFrameSinkId() {
return frame_sink_id_;
}
+gfx::Size TestRenderWidgetHostView::GetMinimumSize() const {
+ return gfx::Size();
+}
+
+gfx::Size TestRenderWidgetHostView::GetMaximumSize() const {
+ return gfx::Size();
+}
+
+gfx::NativeCursor TestRenderWidgetHostView::GetCursor(const gfx::Point& point) {
+ return ui::CursorType::kNone;
+}
+
+int TestRenderWidgetHostView::GetNonClientComponent(
+ const gfx::Point& point) const {
+ return 0;
+}
+
+bool TestRenderWidgetHostView::ShouldDescendIntoChildForEventHandling(
+ aura::Window* child,
+ const gfx::Point& location) {
+ return false;
+}
+
+bool TestRenderWidgetHostView::CanFocus() {
+ return false;
+}
+
+bool TestRenderWidgetHostView::HasHitTestMask() const {
+ return false;
+}
+
+void TestRenderWidgetHostView::GetHitTestMask(gfx::Path* mask) const {}
+
TestRenderViewHost::TestRenderViewHost(
SiteInstance* instance,
std::unique_ptr<RenderWidgetHostImpl> widget,
« no previous file with comments | « content/test/test_render_view_host.h ('k') | ui/views/window/dialog_client_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698