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

Unified Diff: cc/resources/tile_manager_unittest.cc

Issue 15715031: cc: Remove memory state from tile management (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/tile_manager.cc ('k') | cc/test/fake_tile_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/tile_manager_unittest.cc
diff --git a/cc/resources/tile_manager_unittest.cc b/cc/resources/tile_manager_unittest.cc
index 80290e6192e5f8ab2fe83ff4c243a1289c2ddd38..5f432b06d17688012c2e0944b57b816083b788e9 100644
--- a/cc/resources/tile_manager_unittest.cc
+++ b/cc/resources/tile_manager_unittest.cc
@@ -4,6 +4,7 @@
#include "cc/resources/tile.h"
#include "cc/resources/tile_priority.h"
+#include "cc/test/fake_output_surface.h"
#include "cc/test/fake_tile_manager.h"
#include "cc/test/fake_tile_manager_client.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -55,7 +56,10 @@ class TileManagerTest : public testing::Test {
void Initialize(int max_memory_tiles,
TileMemoryLimitPolicy memory_limit_policy,
TreePriority tree_priority) {
- tile_manager_ = make_scoped_ptr(new FakeTileManager(&tile_manager_client_));
+ output_surface_ = FakeOutputSurface::Create3d();
+ resource_provider_ = ResourceProvider::Create(output_surface_.get(), 0);
+ tile_manager_ = make_scoped_ptr(
+ new FakeTileManager(&tile_manager_client_, resource_provider_.get()));
GlobalStateThatImpactsTilePriority state;
gfx::Size tile_size = settings_.default_tile_size;
@@ -105,8 +109,9 @@ class TileManagerTest : public testing::Test {
for (TileVector::const_iterator it = tiles.begin();
it != tiles.end();
++it) {
- if ((*it)->IsAssignedGpuMemory())
+ if ((*it)->HasRasterTaskForTesting())
++has_memory_count;
+ (*it)->ResetRasterTaskForTesting();
}
return has_memory_count;
}
@@ -116,6 +121,8 @@ class TileManagerTest : public testing::Test {
LayerTreeSettings settings_;
scoped_ptr<FakeTileManager> tile_manager_;
scoped_refptr<FakePicturePileImpl> picture_pile_;
+ scoped_ptr<FakeOutputSurface> output_surface_;
+ scoped_ptr<ResourceProvider> resource_provider_;
};
TEST_F(TileManagerTest, EnoughMemoryAllowAnything) {
@@ -141,6 +148,7 @@ TEST_F(TileManagerTest, EnoughMemoryAllowAnything) {
pending_now.clear();
active_pending_soon.clear();
never_bin.clear();
+
TearDown();
}
« no previous file with comments | « cc/resources/tile_manager.cc ('k') | cc/test/fake_tile_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698