| 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/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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 TestRenderWidgetHostView::TestRenderWidgetHostView(RenderWidgetHost* rwh) | 64 TestRenderWidgetHostView::TestRenderWidgetHostView(RenderWidgetHost* rwh) |
| 65 : rwh_(RenderWidgetHostImpl::From(rwh)), | 65 : rwh_(RenderWidgetHostImpl::From(rwh)), |
| 66 is_showing_(false), | 66 is_showing_(false), |
| 67 is_occluded_(false), | 67 is_occluded_(false), |
| 68 did_swap_compositor_frame_(false) { | 68 did_swap_compositor_frame_(false) { |
| 69 #if defined(OS_ANDROID) | 69 #if defined(OS_ANDROID) |
| 70 // Not all tests initialize or need a context provider factory. | 70 // Not all tests initialize or need a context provider factory. |
| 71 if (ContextProviderFactoryImpl::GetInstance()) { | 71 if (ContextProviderFactoryImpl::GetInstance()) { |
| 72 frame_sink_id_ = AllocateFrameSinkId(); | 72 frame_sink_id_ = AllocateFrameSinkId(); |
| 73 surface_id_allocator_ = | |
| 74 base::MakeUnique<cc::SurfaceIdAllocator>(frame_sink_id_); | |
| 75 GetSurfaceManager()->RegisterFrameSinkId(frame_sink_id_); | 73 GetSurfaceManager()->RegisterFrameSinkId(frame_sink_id_); |
| 76 } | 74 } |
| 77 #else | 75 #else |
| 78 // Not all tests initialize or need an image transport factory. | 76 // Not all tests initialize or need an image transport factory. |
| 79 if (ImageTransportFactory::GetInstance()) { | 77 if (ImageTransportFactory::GetInstance()) { |
| 80 frame_sink_id_ = AllocateFrameSinkId(); | 78 frame_sink_id_ = AllocateFrameSinkId(); |
| 81 surface_id_allocator_ = | |
| 82 base::MakeUnique<cc::SurfaceIdAllocator>(frame_sink_id_); | |
| 83 GetSurfaceManager()->RegisterFrameSinkId(frame_sink_id_); | 79 GetSurfaceManager()->RegisterFrameSinkId(frame_sink_id_); |
| 84 } | 80 } |
| 85 #endif | 81 #endif |
| 86 | 82 |
| 87 rwh_->SetView(this); | 83 rwh_->SetView(this); |
| 88 } | 84 } |
| 89 | 85 |
| 90 TestRenderWidgetHostView::~TestRenderWidgetHostView() { | 86 TestRenderWidgetHostView::~TestRenderWidgetHostView() { |
| 91 cc::SurfaceManager* manager = nullptr; | 87 cc::SurfaceManager* manager = nullptr; |
| 92 #if defined(OS_ANDROID) | 88 #if defined(OS_ANDROID) |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 | 344 |
| 349 TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() { | 345 TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() { |
| 350 return contents()->GetMainFrame(); | 346 return contents()->GetMainFrame(); |
| 351 } | 347 } |
| 352 | 348 |
| 353 TestWebContents* RenderViewHostImplTestHarness::contents() { | 349 TestWebContents* RenderViewHostImplTestHarness::contents() { |
| 354 return static_cast<TestWebContents*>(web_contents()); | 350 return static_cast<TestWebContents*>(web_contents()); |
| 355 } | 351 } |
| 356 | 352 |
| 357 } // namespace content | 353 } // namespace content |
| OLD | NEW |