| 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/media/capture/web_contents_video_capture_device.h" | 5 #include "content/browser/media/capture/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 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 } else { | 664 } else { |
| 665 // Simulate a non-accelerated paint. | 665 // Simulate a non-accelerated paint. |
| 666 NotificationService::current()->Notify( | 666 NotificationService::current()->Notify( |
| 667 NOTIFICATION_RENDER_WIDGET_HOST_DID_UPDATE_BACKING_STORE, | 667 NOTIFICATION_RENDER_WIDGET_HOST_DID_UPDATE_BACKING_STORE, |
| 668 Source<RenderWidgetHost>(web_contents_->GetRenderViewHost()), | 668 Source<RenderWidgetHost>(web_contents_->GetRenderViewHost()), |
| 669 NotificationService::NoDetails()); | 669 NotificationService::NoDetails()); |
| 670 } | 670 } |
| 671 } | 671 } |
| 672 | 672 |
| 673 void SimulateSourceSizeChange(const gfx::Size& size) { | 673 void SimulateSourceSizeChange(const gfx::Size& size) { |
| 674 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 674 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 675 CaptureTestView* test_view = static_cast<CaptureTestView*>( | 675 CaptureTestView* test_view = static_cast<CaptureTestView*>( |
| 676 web_contents_->GetRenderViewHost()->GetView()); | 676 web_contents_->GetRenderViewHost()->GetView()); |
| 677 test_view->SetSize(size); | 677 test_view->SetSize(size); |
| 678 // Normally, RenderWidgetHostImpl would notify WebContentsImpl that the size | 678 // Normally, RenderWidgetHostImpl would notify WebContentsImpl that the size |
| 679 // has changed. However, in this test setup where there is no render | 679 // has changed. However, in this test setup where there is no render |
| 680 // process, we must notify WebContentsImpl directly. | 680 // process, we must notify WebContentsImpl directly. |
| 681 WebContentsImpl* const as_web_contents_impl = | 681 WebContentsImpl* const as_web_contents_impl = |
| 682 static_cast<WebContentsImpl*>(web_contents_.get()); | 682 static_cast<WebContentsImpl*>(web_contents_.get()); |
| 683 RenderWidgetHostDelegate* const as_rwh_delegate = | 683 RenderWidgetHostDelegate* const as_rwh_delegate = |
| 684 static_cast<RenderWidgetHostDelegate*>(as_web_contents_impl); | 684 static_cast<RenderWidgetHostDelegate*>(as_web_contents_impl); |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1135 policies[i], gfx::Size(1000, 1000), gfx::Size(1000, 1000)); | 1135 policies[i], gfx::Size(1000, 1000), gfx::Size(1000, 1000)); |
| 1136 RunTestForPreferredSize( | 1136 RunTestForPreferredSize( |
| 1137 policies[i], gfx::Size(1600, 1000), gfx::Size(1600, 1000)); | 1137 policies[i], gfx::Size(1600, 1000), gfx::Size(1600, 1000)); |
| 1138 RunTestForPreferredSize( | 1138 RunTestForPreferredSize( |
| 1139 policies[i], gfx::Size(837, 999), gfx::Size(837, 999)); | 1139 policies[i], gfx::Size(837, 999), gfx::Size(837, 999)); |
| 1140 } | 1140 } |
| 1141 } | 1141 } |
| 1142 | 1142 |
| 1143 } // namespace | 1143 } // namespace |
| 1144 } // namespace content | 1144 } // namespace content |
| OLD | NEW |