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

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

Issue 2166423002: ui::ContextFactory should not create SurfaceIdAllocators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Android + Addressed Antoine's comment Created 4 years, 5 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 params->method = "GET"; 57 params->method = "GET";
58 params->page_state = PageState::CreateFromURL(url); 58 params->page_state = PageState::CreateFromURL(url);
59 } 59 }
60 60
61 TestRenderWidgetHostView::TestRenderWidgetHostView(RenderWidgetHost* rwh) 61 TestRenderWidgetHostView::TestRenderWidgetHostView(RenderWidgetHost* rwh)
62 : rwh_(RenderWidgetHostImpl::From(rwh)), 62 : rwh_(RenderWidgetHostImpl::From(rwh)),
63 is_showing_(false), 63 is_showing_(false),
64 is_occluded_(false), 64 is_occluded_(false),
65 did_swap_compositor_frame_(false) { 65 did_swap_compositor_frame_(false) {
66 #if defined(OS_ANDROID) 66 #if defined(OS_ANDROID)
67 surface_id_allocator_ = CreateSurfaceIdAllocator(); 67 surface_id_allocator_.reset(
68 new cc::SurfaceIdAllocator(AllocateSurfaceClientId()));
68 #else 69 #else
69 // Not all tests initialize or need an image transport factory. 70 // Not all tests initialize or need an image transport factory.
70 if (ImageTransportFactory::GetInstance()) 71 if (ImageTransportFactory::GetInstance())
71 surface_id_allocator_ = CreateSurfaceIdAllocator(); 72 surface_id_allocator_.reset(
73 new cc::SurfaceIdAllocator(AllocateSurfaceClientId()));
72 #endif 74 #endif
73 75
74 rwh_->SetView(this); 76 rwh_->SetView(this);
75 } 77 }
76 78
77 TestRenderWidgetHostView::~TestRenderWidgetHostView() { 79 TestRenderWidgetHostView::~TestRenderWidgetHostView() {
78 } 80 }
79 81
80 RenderWidgetHost* TestRenderWidgetHostView::GetRenderWidgetHost() const { 82 RenderWidgetHost* TestRenderWidgetHostView::GetRenderWidgetHost() const {
81 return rwh_; 83 return rwh_;
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 330
329 TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() { 331 TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() {
330 return contents()->GetMainFrame(); 332 return contents()->GetMainFrame();
331 } 333 }
332 334
333 TestWebContents* RenderViewHostImplTestHarness::contents() { 335 TestWebContents* RenderViewHostImplTestHarness::contents() {
334 return static_cast<TestWebContents*>(web_contents()); 336 return static_cast<TestWebContents*>(web_contents());
335 } 337 }
336 338
337 } // namespace content 339 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698