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

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

Issue 2702093002: Consistent CopyFromSurface() API, consolidated to RWHV (Closed)
Patch Set: Per alexmos, simplification in NavigationEntryScreenshotManager. Created 3 years, 9 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 #include "content/test/test_render_view_host.h" 5 #include "content/test/test_render_view_host.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 } 110 }
111 111
112 ui::TextInputClient* TestRenderWidgetHostView::GetTextInputClient() { 112 ui::TextInputClient* TestRenderWidgetHostView::GetTextInputClient() {
113 return &text_input_client_; 113 return &text_input_client_;
114 } 114 }
115 115
116 bool TestRenderWidgetHostView::HasFocus() const { 116 bool TestRenderWidgetHostView::HasFocus() const {
117 return true; 117 return true;
118 } 118 }
119 119
120 bool TestRenderWidgetHostView::IsSurfaceAvailableForCopy() const {
121 return true;
122 }
123
124 void TestRenderWidgetHostView::Show() { 120 void TestRenderWidgetHostView::Show() {
125 is_showing_ = true; 121 is_showing_ = true;
126 is_occluded_ = false; 122 is_occluded_ = false;
127 } 123 }
128 124
129 void TestRenderWidgetHostView::Hide() { 125 void TestRenderWidgetHostView::Hide() {
130 is_showing_ = false; 126 is_showing_ = false;
131 } 127 }
132 128
133 bool TestRenderWidgetHostView::IsShowing() { 129 bool TestRenderWidgetHostView::IsShowing() {
(...skipping 11 matching lines...) Expand all
145 void TestRenderWidgetHostView::RenderProcessGone(base::TerminationStatus status, 141 void TestRenderWidgetHostView::RenderProcessGone(base::TerminationStatus status,
146 int error_code) { 142 int error_code) {
147 delete this; 143 delete this;
148 } 144 }
149 145
150 void TestRenderWidgetHostView::Destroy() { delete this; } 146 void TestRenderWidgetHostView::Destroy() { delete this; }
151 147
152 gfx::Rect TestRenderWidgetHostView::GetViewBounds() const { 148 gfx::Rect TestRenderWidgetHostView::GetViewBounds() const {
153 return gfx::Rect(); 149 return gfx::Rect();
154 } 150 }
155 151
ncarter (slow) 2017/03/01 18:34:26 with the removal of the overrides, TestRenderWidge
miu 2017/03/01 22:18:24 Yes...Only the WCVideoCaptureDevice unit tests wou
156 void TestRenderWidgetHostView::CopyFromCompositingSurface(
157 const gfx::Rect& src_subrect,
158 const gfx::Size& dst_size,
159 const ReadbackRequestCallback& callback,
160 const SkColorType preferred_color_type) {
161 callback.Run(SkBitmap(), content::READBACK_FAILED);
162 }
163
164 void TestRenderWidgetHostView::CopyFromCompositingSurfaceToVideoFrame(
165 const gfx::Rect& src_subrect,
166 const scoped_refptr<media::VideoFrame>& target,
167 const base::Callback<void(const gfx::Rect&, bool)>& callback) {
168 callback.Run(gfx::Rect(), false);
169 }
170
171 bool TestRenderWidgetHostView::CanCopyToVideoFrame() const {
172 return false;
173 }
174
175 bool TestRenderWidgetHostView::HasAcceleratedSurface( 152 bool TestRenderWidgetHostView::HasAcceleratedSurface(
176 const gfx::Size& desired_size) { 153 const gfx::Size& desired_size) {
177 return false; 154 return false;
178 } 155 }
179 156
180 #if defined(OS_MACOSX) 157 #if defined(OS_MACOSX)
181 158
182 ui::AcceleratedWidgetMac* TestRenderWidgetHostView::GetAcceleratedWidgetMac() 159 ui::AcceleratedWidgetMac* TestRenderWidgetHostView::GetAcceleratedWidgetMac()
183 const { 160 const {
184 return nullptr; 161 return nullptr;
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 317
341 TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() { 318 TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() {
342 return contents()->GetMainFrame(); 319 return contents()->GetMainFrame();
343 } 320 }
344 321
345 TestWebContents* RenderViewHostImplTestHarness::contents() { 322 TestWebContents* RenderViewHostImplTestHarness::contents() {
346 return static_cast<TestWebContents*>(web_contents()); 323 return static_cast<TestWebContents*>(web_contents());
347 } 324 }
348 325
349 } // namespace content 326 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698