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

Side by Side Diff: cc/resources/resource_pool_unittest.cc

Issue 2171143002: cc: Get rid of non-delegated rendering in most cc unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@killdirecttests
Patch Set: fakeoutputsurface: no-constructor 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
« no previous file with comments | « cc/layers/ui_resource_layer_unittest.cc ('k') | cc/resources/scoped_resource_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/resources/resource_pool.h" 5 #include "cc/resources/resource_pool.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
11 #include "cc/resources/resource_util.h" 11 #include "cc/resources/resource_util.h"
12 #include "cc/resources/scoped_resource.h" 12 #include "cc/resources/scoped_resource.h"
13 #include "cc/test/fake_output_surface.h" 13 #include "cc/test/fake_output_surface.h"
14 #include "cc/test/fake_output_surface_client.h" 14 #include "cc/test/fake_output_surface_client.h"
15 #include "cc/test/fake_resource_provider.h" 15 #include "cc/test/fake_resource_provider.h"
16 #include "cc/test/test_shared_bitmap_manager.h" 16 #include "cc/test/test_shared_bitmap_manager.h"
17 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
18 18
19 namespace cc { 19 namespace cc {
20 namespace { 20 namespace {
21 21
22 class ResourcePoolTest : public testing::Test { 22 class ResourcePoolTest : public testing::Test {
23 public: 23 public:
24 void SetUp() override { 24 void SetUp() override {
25 output_surface_ = FakeOutputSurface::Create3d(); 25 output_surface_ = FakeOutputSurface::CreateDelegating3d();
26 ASSERT_TRUE(output_surface_->BindToClient(&output_surface_client_)); 26 ASSERT_TRUE(output_surface_->BindToClient(&output_surface_client_));
27 shared_bitmap_manager_.reset(new TestSharedBitmapManager()); 27 shared_bitmap_manager_.reset(new TestSharedBitmapManager());
28 resource_provider_ = FakeResourceProvider::Create( 28 resource_provider_ = FakeResourceProvider::Create(
29 output_surface_.get(), shared_bitmap_manager_.get()); 29 output_surface_.get(), shared_bitmap_manager_.get());
30 task_runner_ = base::ThreadTaskRunnerHandle::Get(); 30 task_runner_ = base::ThreadTaskRunnerHandle::Get();
31 resource_pool_ = 31 resource_pool_ =
32 ResourcePool::Create(resource_provider_.get(), task_runner_.get()); 32 ResourcePool::Create(resource_provider_.get(), task_runner_.get());
33 } 33 }
34 34
35 protected: 35 protected:
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 reacquired_resource = resource_pool_->TryAcquireResourceForPartialRaster( 280 reacquired_resource = resource_pool_->TryAcquireResourceForPartialRaster(
281 content_ids[2], second_invalidated_rect, content_ids[1], 281 content_ids[2], second_invalidated_rect, content_ids[1],
282 &total_invalidated_rect); 282 &total_invalidated_rect);
283 EXPECT_EQ(resource, reacquired_resource); 283 EXPECT_EQ(resource, reacquired_resource);
284 EXPECT_EQ(expected_total_invalidated_rect, total_invalidated_rect); 284 EXPECT_EQ(expected_total_invalidated_rect, total_invalidated_rect);
285 resource_pool_->ReleaseResource(reacquired_resource); 285 resource_pool_->ReleaseResource(reacquired_resource);
286 } 286 }
287 287
288 } // namespace 288 } // namespace
289 } // namespace cc 289 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/ui_resource_layer_unittest.cc ('k') | cc/resources/scoped_resource_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698