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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 2321883002: cc: Remove SetMemoryPolicy from OutputSurface and Display. (Closed)
Patch Set: nits Created 4 years, 3 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/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/layer_tree_settings.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest.cc
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 93cc08272f8c20764d74f652a9d4df597011c43d..bdccdc5713c550c14960cc142b7b0fb2dae9d85d 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -4400,85 +4400,6 @@ class LayerTreeHostTestElasticOverscroll : public LayerTreeHostTest {
MULTI_THREAD_TEST_F(LayerTreeHostTestElasticOverscroll);
-class LayerTreeHostTestSetMemoryPolicyOnLostOutputSurface
- : public LayerTreeHostTest {
- protected:
- LayerTreeHostTestSetMemoryPolicyOnLostOutputSurface()
- : first_output_surface_memory_limit_(4321234),
- second_output_surface_memory_limit_(1234321) {}
-
- std::unique_ptr<OutputSurface> CreateDisplayOutputSurface(
- scoped_refptr<ContextProvider> compositor_context_provider) override {
- if (!first_context_provider_) {
- first_context_provider_ = TestContextProvider::Create();
- compositor_context_provider = first_context_provider_;
- } else {
- EXPECT_FALSE(second_context_provider_);
- second_context_provider_ = TestContextProvider::Create();
- compositor_context_provider = second_context_provider_;
- }
-
- auto output_surface =
- FakeOutputSurface::Create3d(std::move(compositor_context_provider));
- output_surface->SetMemoryPolicyToSetAtBind(
- base::MakeUnique<ManagedMemoryPolicy>(
- second_context_provider_.get() ? second_output_surface_memory_limit_
- : first_output_surface_memory_limit_,
- gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE,
- ManagedMemoryPolicy::kDefaultNumResourcesLimit));
- return std::move(output_surface);
- }
-
- void SetupTree() override {
- root_ = FakePictureLayer::Create(&client_);
- root_->SetBounds(gfx::Size(20, 20));
- layer_tree()->SetRootLayer(root_);
- LayerTreeHostTest::SetupTree();
- client_.set_bounds(root_->bounds());
- }
-
- void BeginTest() override { PostSetNeedsCommitToMainThread(); }
-
- void DidCommitAndDrawFrame() override {
- // Lost context sometimes takes two frames to recreate. The third frame
- // is sometimes aborted, so wait until the fourth frame to verify that
- // the memory has been set, and the fifth frame to end the test.
- if (layer_tree_host()->SourceFrameNumber() < 5) {
- layer_tree_host()->SetNeedsCommit();
- } else if (layer_tree_host()->SourceFrameNumber() == 5) {
- EndTest();
- }
- }
-
- void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
- switch (impl->active_tree()->source_frame_number()) {
- case 1:
- EXPECT_EQ(first_output_surface_memory_limit_,
- impl->memory_allocation_limit_bytes());
- // Lose the output surface.
- first_context_provider_->TestContext3d()->loseContextCHROMIUM(
- GL_GUILTY_CONTEXT_RESET_ARB, GL_INNOCENT_CONTEXT_RESET_ARB);
- break;
- case 4:
- EXPECT_EQ(second_output_surface_memory_limit_,
- impl->memory_allocation_limit_bytes());
- break;
- }
- }
-
- void AfterTest() override {}
-
- scoped_refptr<TestContextProvider> first_context_provider_;
- scoped_refptr<TestContextProvider> second_context_provider_;
- size_t first_output_surface_memory_limit_;
- size_t second_output_surface_memory_limit_;
- FakeContentLayerClient client_;
- scoped_refptr<Layer> root_;
-};
-
-SINGLE_AND_MULTI_THREAD_TEST_F(
- LayerTreeHostTestSetMemoryPolicyOnLostOutputSurface);
-
struct TestSwapPromiseResult {
TestSwapPromiseResult()
: did_activate_called(false),
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/layer_tree_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698