OLD | NEW |
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/time.h" | 10 #include "base/time.h" |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 // Create our (self-registering) RVH factory, so that when we create a | 432 // Create our (self-registering) RVH factory, so that when we create a |
433 // WebContents, it in turn creates CaptureTestRenderViewHosts. | 433 // WebContents, it in turn creates CaptureTestRenderViewHosts. |
434 render_view_host_factory_.reset( | 434 render_view_host_factory_.reset( |
435 new CaptureTestRenderViewHostFactory(&controller_)); | 435 new CaptureTestRenderViewHostFactory(&controller_)); |
436 | 436 |
437 browser_context_.reset(new TestBrowserContext()); | 437 browser_context_.reset(new TestBrowserContext()); |
438 | 438 |
439 scoped_refptr<SiteInstance> site_instance = | 439 scoped_refptr<SiteInstance> site_instance = |
440 SiteInstance::Create(browser_context_.get()); | 440 SiteInstance::Create(browser_context_.get()); |
441 static_cast<SiteInstanceImpl*>(site_instance.get())-> | 441 static_cast<SiteInstanceImpl*>(site_instance.get())-> |
442 set_render_process_host_factory(render_process_host_factory_.get()); | 442 SetRenderProcessHostFactory(render_process_host_factory_.get()); |
443 web_contents_.reset( | 443 web_contents_.reset( |
444 TestWebContents::Create(browser_context_.get(), site_instance)); | 444 TestWebContents::Create(browser_context_.get(), site_instance)); |
445 | 445 |
446 // This is actually a CaptureTestRenderViewHost. | 446 // This is actually a CaptureTestRenderViewHost. |
447 RenderWidgetHostImpl* rwh = | 447 RenderWidgetHostImpl* rwh = |
448 RenderWidgetHostImpl::From(web_contents_->GetRenderViewHost()); | 448 RenderWidgetHostImpl::From(web_contents_->GetRenderViewHost()); |
449 | 449 |
450 std::string device_id = | 450 std::string device_id = |
451 WebContentsCaptureUtil::AppendWebContentsDeviceScheme( | 451 WebContentsCaptureUtil::AppendWebContentsDeviceScheme( |
452 base::StringPrintf("%d:%d", rwh->GetProcess()->GetID(), | 452 base::StringPrintf("%d:%d", rwh->GetProcess()->GetID(), |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 should_poll.RecordSample(); | 954 should_poll.RecordSample(); |
955 t += timer_interval / 3; | 955 t += timer_interval / 3; |
956 ASSERT_FALSE(should_not_poll.IsOverdueForSamplingAt(t)) | 956 ASSERT_FALSE(should_not_poll.IsOverdueForSamplingAt(t)) |
957 << "Sampled last event; should not be dirty."; | 957 << "Sampled last event; should not be dirty."; |
958 ASSERT_TRUE(should_poll.IsOverdueForSamplingAt(t)) | 958 ASSERT_TRUE(should_poll.IsOverdueForSamplingAt(t)) |
959 << "If updates are unreliable, must fall back to polling when idle."; | 959 << "If updates are unreliable, must fall back to polling when idle."; |
960 should_poll.RecordSample(); | 960 should_poll.RecordSample(); |
961 } | 961 } |
962 | 962 |
963 } // namespace content | 963 } // namespace content |
964 | |
OLD | NEW |