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

Side by Side Diff: cc/surfaces/display_unittest.cc

Issue 2872883002: Rename EvictFrame, EvictSurface to EvictCurrentSurface (Closed)
Patch Set: Rebase Created 3 years, 7 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "cc/surfaces/display.h" 5 #include "cc/surfaces/display.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/test/null_task_runner.h" 10 #include "base/test/null_task_runner.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 DisplayTest() 85 DisplayTest()
86 : support_(CompositorFrameSinkSupport::Create( 86 : support_(CompositorFrameSinkSupport::Create(
87 nullptr, 87 nullptr,
88 &manager_, 88 &manager_,
89 kArbitraryFrameSinkId, 89 kArbitraryFrameSinkId,
90 true /* is_root */, 90 true /* is_root */,
91 true /* handles_frame_sink_id_invalidation */, 91 true /* handles_frame_sink_id_invalidation */,
92 true /* needs_sync_points */)), 92 true /* needs_sync_points */)),
93 task_runner_(new base::NullTaskRunner) {} 93 task_runner_(new base::NullTaskRunner) {}
94 94
95 ~DisplayTest() override { support_->EvictFrame(); } 95 ~DisplayTest() override { support_->EvictCurrentSurface(); }
96 96
97 void SetUpDisplay(const RendererSettings& settings, 97 void SetUpDisplay(const RendererSettings& settings,
98 std::unique_ptr<TestWebGraphicsContext3D> context) { 98 std::unique_ptr<TestWebGraphicsContext3D> context) {
99 begin_frame_source_.reset(new StubBeginFrameSource); 99 begin_frame_source_.reset(new StubBeginFrameSource);
100 100
101 std::unique_ptr<FakeOutputSurface> output_surface; 101 std::unique_ptr<FakeOutputSurface> output_surface;
102 if (context) { 102 if (context) {
103 auto provider = TestContextProvider::Create(std::move(context)); 103 auto provider = TestContextProvider::Create(std::move(context));
104 provider->BindToCurrentThread(); 104 provider->BindToCurrentThread();
105 output_surface = FakeOutputSurface::Create3d(std::move(provider)); 105 output_surface = FakeOutputSurface::Create3d(std::move(provider));
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 // Verify DidLoseOutputSurface callback is hooked up correctly. 496 // Verify DidLoseOutputSurface callback is hooked up correctly.
497 EXPECT_EQ(0, client.loss_count()); 497 EXPECT_EQ(0, client.loss_count());
498 output_surface_->context_provider()->ContextGL()->LoseContextCHROMIUM( 498 output_surface_->context_provider()->ContextGL()->LoseContextCHROMIUM(
499 GL_GUILTY_CONTEXT_RESET_ARB, GL_INNOCENT_CONTEXT_RESET_ARB); 499 GL_GUILTY_CONTEXT_RESET_ARB, GL_INNOCENT_CONTEXT_RESET_ARB);
500 output_surface_->context_provider()->ContextGL()->Flush(); 500 output_surface_->context_provider()->ContextGL()->Flush();
501 EXPECT_EQ(1, client.loss_count()); 501 EXPECT_EQ(1, client.loss_count());
502 } 502 }
503 503
504 } // namespace 504 } // namespace
505 } // namespace cc 505 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/compositor_frame_sink_support_unittest.cc ('k') | cc/surfaces/surface_aggregator_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698