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

Side by Side Diff: content/test/test_render_view_host.h

Issue 1713473002: Make TestRenderWidgetHostView::Show/Hide call through to RWHI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@crash
Patch Set: Update web_contents_impl_unittest.cc 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_ 5 #ifndef CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_
6 #define CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_ 6 #define CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // with given parameters. 48 // with given parameters.
49 void InitNavigateParams(FrameHostMsg_DidCommitProvisionalLoad_Params* params, 49 void InitNavigateParams(FrameHostMsg_DidCommitProvisionalLoad_Params* params,
50 int page_id, 50 int page_id,
51 int nav_entry_id, 51 int nav_entry_id,
52 bool did_create_new_entry, 52 bool did_create_new_entry,
53 const GURL& url, 53 const GURL& url,
54 ui::PageTransition transition_type); 54 ui::PageTransition transition_type);
55 55
56 // TestRenderViewHostView ------------------------------------------------------ 56 // TestRenderViewHostView ------------------------------------------------------
57 57
58 // Subclass the RenderViewHost's view so that we can call Show(), etc., 58 // Subclass the RenderViewHost's view.
59 // without having side-effects.
60 class TestRenderWidgetHostView : public RenderWidgetHostViewBase { 59 class TestRenderWidgetHostView : public RenderWidgetHostViewBase {
61 public: 60 public:
62 explicit TestRenderWidgetHostView(RenderWidgetHost* rwh); 61 explicit TestRenderWidgetHostView(RenderWidgetHost* rwh);
63 ~TestRenderWidgetHostView() override; 62 ~TestRenderWidgetHostView() override;
64 63
65 // RenderWidgetHostView implementation. 64 // RenderWidgetHostView implementation.
66 void InitAsChild(gfx::NativeView parent_view) override {} 65 void InitAsChild(gfx::NativeView parent_view) override {}
67 RenderWidgetHost* GetRenderWidgetHost() const override; 66 RenderWidgetHost* GetRenderWidgetHost() const override;
68 void SetSize(const gfx::Size& size) override {} 67 void SetSize(const gfx::Size& size) override {}
69 void SetBounds(const gfx::Rect& rect) override {} 68 void SetBounds(const gfx::Rect& rect) override {}
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 bool GetScreenColorProfile(std::vector<char>* color_profile) override; 135 bool GetScreenColorProfile(std::vector<char>* color_profile) override;
137 gfx::Rect GetBoundsInRootWindow() override; 136 gfx::Rect GetBoundsInRootWindow() override;
138 bool LockMouse() override; 137 bool LockMouse() override;
139 void UnlockMouse() override; 138 void UnlockMouse() override;
140 #if defined(OS_WIN) 139 #if defined(OS_WIN)
141 void SetParentNativeViewAccessible( 140 void SetParentNativeViewAccessible(
142 gfx::NativeViewAccessible accessible_parent) override; 141 gfx::NativeViewAccessible accessible_parent) override;
143 gfx::NativeViewId GetParentForWindowlessPlugin() const override; 142 gfx::NativeViewId GetParentForWindowlessPlugin() const override;
144 #endif 143 #endif
145 144
146 bool is_showing() const { return is_showing_; }
147 bool is_occluded() const { return is_occluded_; } 145 bool is_occluded() const { return is_occluded_; }
148 bool did_swap_compositor_frame() const { return did_swap_compositor_frame_; } 146 bool did_swap_compositor_frame() const { return did_swap_compositor_frame_; }
149 147
150 protected: 148 protected:
151 RenderWidgetHostImpl* rwh_; 149 RenderWidgetHostImpl* rwh_;
152 150
153 private: 151 private:
154 bool is_showing_;
155 bool is_occluded_; 152 bool is_occluded_;
156 bool did_swap_compositor_frame_; 153 bool did_swap_compositor_frame_;
157 ui::DummyTextInputClient text_input_client_; 154 ui::DummyTextInputClient text_input_client_;
158 }; 155 };
159 156
160 #if defined(COMPILER_MSVC) 157 #if defined(COMPILER_MSVC)
161 // See comment for same warning on RenderViewHostImpl. 158 // See comment for same warning on RenderViewHostImpl.
162 #pragma warning(push) 159 #pragma warning(push)
163 #pragma warning(disable: 4250) 160 #pragma warning(disable: 4250)
164 #endif 161 #endif
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 private: 317 private:
321 typedef scoped_ptr<ui::test::ScopedSetSupportedScaleFactors> 318 typedef scoped_ptr<ui::test::ScopedSetSupportedScaleFactors>
322 ScopedSetSupportedScaleFactors; 319 ScopedSetSupportedScaleFactors;
323 ScopedSetSupportedScaleFactors scoped_set_supported_scale_factors_; 320 ScopedSetSupportedScaleFactors scoped_set_supported_scale_factors_;
324 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImplTestHarness); 321 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImplTestHarness);
325 }; 322 };
326 323
327 } // namespace content 324 } // namespace content
328 325
329 #endif // CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_ 326 #endif // CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698