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

Side by Side Diff: content/browser/renderer_host/media/web_contents_video_capture_device_unittest.cc

Issue 16032007: Create RenderFrame/RenderFrameHost for the main frame of a page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removing routing ID expectations. Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/renderer_host/render_frame_host_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/browser/renderer_host/media/web_contents_video_capture_device. h" 5 #include "content/browser/renderer_host/media/web_contents_video_capture_device. h"
6 6
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/debug/debugger.h" 8 #include "base/debug/debugger.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/test/test_timeouts.h" 10 #include "base/test/test_timeouts.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 220
221 // A stub implementation which returns solid-color bitmaps in calls to 221 // A stub implementation which returns solid-color bitmaps in calls to
222 // CopyFromBackingStore(). The behavior is controlled by a 222 // CopyFromBackingStore(). The behavior is controlled by a
223 // CaptureTestSourceController. 223 // CaptureTestSourceController.
224 class CaptureTestRenderViewHost : public TestRenderViewHost { 224 class CaptureTestRenderViewHost : public TestRenderViewHost {
225 public: 225 public:
226 CaptureTestRenderViewHost(SiteInstance* instance, 226 CaptureTestRenderViewHost(SiteInstance* instance,
227 RenderViewHostDelegate* delegate, 227 RenderViewHostDelegate* delegate,
228 RenderWidgetHostDelegate* widget_delegate, 228 RenderWidgetHostDelegate* widget_delegate,
229 int routing_id, 229 int routing_id,
230 int main_frame_routing_id,
230 bool swapped_out, 231 bool swapped_out,
231 CaptureTestSourceController* controller) 232 CaptureTestSourceController* controller)
232 : TestRenderViewHost(instance, delegate, widget_delegate, routing_id, 233 : TestRenderViewHost(instance, delegate, widget_delegate, routing_id,
233 swapped_out), 234 main_frame_routing_id, swapped_out),
234 controller_(controller) { 235 controller_(controller) {
235 // Override the default view installed by TestRenderViewHost; we need 236 // Override the default view installed by TestRenderViewHost; we need
236 // our special subclass which has mocked-out tab capture support. 237 // our special subclass which has mocked-out tab capture support.
237 RenderWidgetHostView* old_view = GetView(); 238 RenderWidgetHostView* old_view = GetView();
238 SetView(new CaptureTestView(this, controller)); 239 SetView(new CaptureTestView(this, controller));
239 delete old_view; 240 delete old_view;
240 } 241 }
241 242
242 // TestRenderViewHost overrides. 243 // TestRenderViewHost overrides.
243 virtual void CopyFromBackingStore( 244 virtual void CopyFromBackingStore(
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 virtual ~CaptureTestRenderViewHostFactory() { 281 virtual ~CaptureTestRenderViewHostFactory() {
281 UnregisterFactory(); 282 UnregisterFactory();
282 } 283 }
283 284
284 // RenderViewHostFactory implementation. 285 // RenderViewHostFactory implementation.
285 virtual RenderViewHost* CreateRenderViewHost( 286 virtual RenderViewHost* CreateRenderViewHost(
286 SiteInstance* instance, 287 SiteInstance* instance,
287 RenderViewHostDelegate* delegate, 288 RenderViewHostDelegate* delegate,
288 RenderWidgetHostDelegate* widget_delegate, 289 RenderWidgetHostDelegate* widget_delegate,
289 int routing_id, 290 int routing_id,
291 int main_frame_routing_id,
290 bool swapped_out, 292 bool swapped_out,
291 SessionStorageNamespace* session_storage_namespace) OVERRIDE { 293 SessionStorageNamespace* session_storage_namespace) OVERRIDE {
292 return new CaptureTestRenderViewHost(instance, delegate, widget_delegate, 294 return new CaptureTestRenderViewHost(instance, delegate, widget_delegate,
293 routing_id, swapped_out, controller_); 295 routing_id, main_frame_routing_id,
296 swapped_out, controller_);
294 } 297 }
295 private: 298 private:
296 CaptureTestSourceController* controller_; 299 CaptureTestSourceController* controller_;
297 300
298 DISALLOW_IMPLICIT_CONSTRUCTORS(CaptureTestRenderViewHostFactory); 301 DISALLOW_IMPLICIT_CONSTRUCTORS(CaptureTestRenderViewHostFactory);
299 }; 302 };
300 303
301 // A stub consumer of captured video frames, which checks the output of 304 // A stub consumer of captured video frames, which checks the output of
302 // WebContentsVideoCaptureDevice. 305 // WebContentsVideoCaptureDevice.
303 class StubConsumer : public media::VideoCaptureDevice::EventHandler { 306 class StubConsumer : public media::VideoCaptureDevice::EventHandler {
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 ASSERT_NO_FATAL_FAILURE(consumer()->WaitForNextColor(SK_ColorGREEN)); 722 ASSERT_NO_FATAL_FAILURE(consumer()->WaitForNextColor(SK_ColorGREEN));
720 source()->SetSolidColor(SK_ColorRED); 723 source()->SetSolidColor(SK_ColorRED);
721 ASSERT_NO_FATAL_FAILURE(consumer()->WaitForNextColor(SK_ColorRED)); 724 ASSERT_NO_FATAL_FAILURE(consumer()->WaitForNextColor(SK_ColorRED));
722 725
723 device()->Stop(); 726 device()->Stop();
724 device()->DeAllocate(); 727 device()->DeAllocate();
725 } 728 }
726 729
727 } // namespace 730 } // namespace
728 } // namespace content 731 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_frame_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698