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

Unified Diff: cc/resources/tile_manager_unittest.cc

Issue 16959022: cc: Make tiles that are not required by trees NEVER_BIN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another test Created 7 years, 6 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
« cc/resources/tile_manager.cc ('K') | « cc/resources/tile_manager.cc ('k') | no next file » | 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 5f432b06d17688012c2e0944b57b816083b788e9..80b2bbcbb1755cd4d9d821b86cda33c67de4f43a 100644
--- a/cc/resources/tile_manager_unittest.cc
+++ b/cc/resources/tile_manager_unittest.cc
@@ -142,7 +142,7 @@ TEST_F(TileManagerTest, EnoughMemoryAllowAnything) {
EXPECT_EQ(3, AssignedMemoryCounts(active_now));
EXPECT_EQ(3, AssignedMemoryCounts(pending_now));
EXPECT_EQ(3, AssignedMemoryCounts(active_pending_soon));
- EXPECT_EQ(1, AssignedMemoryCounts(never_bin));
+ EXPECT_EQ(0, AssignedMemoryCounts(never_bin));
active_now.clear();
pending_now.clear();
@@ -296,6 +296,27 @@ TEST_F(TileManagerTest, TotalOOMMemoryToPending) {
TearDown();
}
+TEST_F(TileManagerTest, TotalOOMActiveSoonMemoryToPending) {
+ // 5 tiles on active tree soon bin, 5 tiles on pending tree now bin,
+ // but only enough memory for 4 tiles. The result is 4 pending tree tiles
+ // get memory, and none of the active tree tiles get memory.
+
+ Initialize(4, ALLOW_ANYTHING, SMOOTHNESS_TAKES_PRIORITY);
+ TileVector active_tree_tiles =
+ CreateTiles(5, TilePriorityForSoonBin(), TilePriority());
+ TileVector pending_tree_tiles =
+ CreateTiles(5, TilePriority(), TilePriorityForNowBin());
+
+ tile_manager()->ManageTiles();
+
+ EXPECT_EQ(0, AssignedMemoryCounts(active_tree_tiles));
+ EXPECT_EQ(4, AssignedMemoryCounts(pending_tree_tiles));
+
+ pending_tree_tiles.clear();
+ active_tree_tiles.clear();
+ TearDown();
+}
+
TEST_F(TileManagerTest, TotalOOMMemoryToActive) {
// 5 tiles on active tree eventually bin, 5 tiles on pending tree now bin,
// but only enough memory for 4 tiles. The result is 5 active tree tiles
« cc/resources/tile_manager.cc ('K') | « cc/resources/tile_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698