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

Unified Diff: content/test/test_render_view_host.h

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
Index: content/test/test_render_view_host.h
diff --git a/content/test/test_render_view_host.h b/content/test/test_render_view_host.h
index 9bbee7414f7423d21581dbee832ec0eddc195e40..87d536c0fcef4e650f1a78a5050ea02c807101ab 100644
--- a/content/test/test_render_view_host.h
+++ b/content/test/test_render_view_host.h
@@ -19,6 +19,8 @@
#include "content/public/common/web_preferences.h"
#include "content/public/test/mock_render_process_host.h"
#include "content/public/test/test_renderer_host.h"
+#include "ui/aura/window.h"
+#include "ui/aura/window_delegate.h"
#include "ui/base/ime/dummy_text_input_client.h"
#include "ui/base/layout.h"
#include "ui/base/page_transition_types.h"
@@ -56,12 +58,13 @@ void InitNavigateParams(FrameHostMsg_DidCommitProvisionalLoad_Params* params,
// Subclass the RenderViewHost's view so that we can call Show(), etc.,
// without having side-effects.
-class TestRenderWidgetHostView : public RenderWidgetHostViewBase {
+class TestRenderWidgetHostView : public RenderWidgetHostViewBase,
+ public aura::WindowDelegate {
public:
explicit TestRenderWidgetHostView(RenderWidgetHost* rwh);
~TestRenderWidgetHostView() override;
- // RenderWidgetHostView implementation.
+ // RenderWidgetHostView:
void InitAsChild(gfx::NativeView parent_view) override {}
RenderWidgetHost* GetRenderWidgetHost() const override;
void SetSize(const gfx::Size& size) override {}
@@ -96,7 +99,7 @@ class TestRenderWidgetHostView : public RenderWidgetHostViewBase {
void ClearCompositorFrame() override {}
void SetNeedsBeginFrames(bool needs_begin_frames) override {}
- // RenderWidgetHostViewBase implementation.
+ // RenderWidgetHostViewBase:
void InitAsPopup(RenderWidgetHostView* parent_host_view,
const gfx::Rect& bounds) override {}
void InitAsFullscreen(RenderWidgetHostView* reference_host_view) override {}
@@ -113,6 +116,26 @@ class TestRenderWidgetHostView : public RenderWidgetHostViewBase {
void UnlockMouse() override;
cc::FrameSinkId GetFrameSinkId() override;
+ // aura::WindowDelegate:
+ gfx::Size GetMinimumSize() const override;
+ gfx::Size GetMaximumSize() const override;
+ void OnBoundsChanged(const gfx::Rect& old_bounds,
+ const gfx::Rect& new_bounds) override {}
+ gfx::NativeCursor GetCursor(const gfx::Point& point) override;
+ int GetNonClientComponent(const gfx::Point& point) const override;
+ bool ShouldDescendIntoChildForEventHandling(
+ aura::Window* child,
+ const gfx::Point& location) override;
+ bool CanFocus() override;
+ void OnCaptureLost() override {}
+ void OnPaint(const ui::PaintContext& context) override {}
+ void OnDeviceScaleFactorChanged(float device_scale_factor) override {}
+ void OnWindowDestroying(aura::Window* window) override {}
+ void OnWindowDestroyed(aura::Window* window) override {}
+ void OnWindowTargetVisibilityChanged(bool visible) override {}
+ bool HasHitTestMask() const override;
+ void GetHitTestMask(gfx::Path* mask) const override;
+
bool is_showing() const { return is_showing_; }
bool is_occluded() const { return is_occluded_; }
bool did_swap_compositor_frame() const { return did_swap_compositor_frame_; }
@@ -135,6 +158,7 @@ class TestRenderWidgetHostView : public RenderWidgetHostViewBase {
bool did_change_compositor_frame_sink_ = false;
SkColor background_color_;
ui::DummyTextInputClient text_input_client_;
+ aura::Window* window_;
};
#if defined(COMPILER_MSVC)

Powered by Google App Engine
This is Rietveld 408576698