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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 2445553002: cc: Make OutputSurface entirely live on one thread in tests. (Closed)
Patch Set: osonthread: fixcontextdeleteintest Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/test_hooks.h ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl_unittest.cc
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index d73bf72807aa82371b3e37d916cdf2fa5c093a3d..b161befe837e1f08cb5b7adfc075f6a4246347e8 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -8227,18 +8227,39 @@ TEST_F(LayerTreeHostImplTest, CreateETC1UIResource) {
void ShutdownReleasesContext_Callback(
std::unique_ptr<CopyOutputResult> result) {}
+class FrameSinkClient : public TestCompositorFrameSinkClient {
+ public:
+ explicit FrameSinkClient(
+ scoped_refptr<ContextProvider> display_context_provider)
+ : display_context_provider_(std::move(display_context_provider)) {}
+
+ std::unique_ptr<OutputSurface> CreateDisplayOutputSurface(
+ scoped_refptr<ContextProvider> compositor_context_provider) override {
+ return FakeOutputSurface::Create3d(std::move(display_context_provider_));
+ }
+
+ void DisplayReceivedCompositorFrame(const CompositorFrame& frame) override {}
+ void DisplayWillDrawAndSwap(bool will_draw_and_swap,
+ const RenderPassList& render_passes) override {}
+ void DisplayDidDrawAndSwap() override {}
+
+ private:
+ scoped_refptr<ContextProvider> display_context_provider_;
+};
+
TEST_F(LayerTreeHostImplTest, ShutdownReleasesContext) {
scoped_refptr<TestContextProvider> context_provider =
TestContextProvider::Create();
+ FrameSinkClient test_client_(context_provider);
- CreateHostImpl(
- DefaultSettings(),
- base::MakeUnique<TestCompositorFrameSink>(
- context_provider, TestContextProvider::CreateWorker(),
- FakeOutputSurface::Create3d(context_provider), nullptr, nullptr,
- RendererSettings(), base::ThreadTaskRunnerHandle::Get().get(),
- true /* synchronous_composite */,
- false /* force_disable_reclaim_resources */));
+ auto compositor_frame_sink = base::MakeUnique<TestCompositorFrameSink>(
+ context_provider, TestContextProvider::CreateWorker(), nullptr, nullptr,
+ RendererSettings(), base::ThreadTaskRunnerHandle::Get().get(),
+ true /* synchronous_composite */,
+ false /* force_disable_reclaim_resources */);
+ compositor_frame_sink->SetClient(&test_client_);
+
+ CreateHostImpl(DefaultSettings(), std::move(compositor_frame_sink));
SetupRootLayerImpl(LayerImpl::Create(host_impl_->active_tree(), 1));
« no previous file with comments | « cc/test/test_hooks.h ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698