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

Unified Diff: cc/resources/tile_manager_unittest.cc

Issue 736753002: cc: Implement geometry-based tile eviction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years 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
Index: cc/resources/tile_manager_unittest.cc
diff --git a/cc/resources/tile_manager_unittest.cc b/cc/resources/tile_manager_unittest.cc
index e143dd358c931447f8bcb1c2fdaac65c86504053..eb5d737d8b28aeb7412a98547f78b26794aa4e6e 100644
--- a/cc/resources/tile_manager_unittest.cc
+++ b/cc/resources/tile_manager_unittest.cc
@@ -483,6 +483,8 @@ TEST_F(TileManagerTilePriorityQueueTest, EvictionTilePriorityQueue) {
// Here we expect to get increasing ACTIVE_TREE priority_bin.
queue.Reset();
host_impl_.BuildEvictionQueue(&queue, SMOOTHNESS_TAKES_PRIORITY);
+ int distance_increasing = 0;
+ int distance_decreasing = 0;
while (!queue.IsEmpty()) {
Tile* tile = queue.Top();
EXPECT_TRUE(tile);
@@ -499,8 +501,11 @@ TEST_F(TileManagerTilePriorityQueueTest, EvictionTilePriorityQueue) {
tile->required_for_activation());
if (last_tile->required_for_activation() ==
tile->required_for_activation()) {
- EXPECT_GE(last_tile->priority(ACTIVE_TREE).distance_to_visible,
- tile->priority(ACTIVE_TREE).distance_to_visible);
+ if (last_tile->priority(ACTIVE_TREE).distance_to_visible >=
+ tile->priority(ACTIVE_TREE).distance_to_visible)
+ ++distance_decreasing;
+ else
+ ++distance_increasing;
}
}
@@ -510,6 +515,8 @@ TEST_F(TileManagerTilePriorityQueueTest, EvictionTilePriorityQueue) {
queue.Pop();
}
+ EXPECT_EQ(3, distance_increasing);
+ EXPECT_EQ(16, distance_decreasing);
EXPECT_EQ(tile_count, smoothness_tiles.size());
EXPECT_EQ(all_tiles, smoothness_tiles);
@@ -518,6 +525,8 @@ TEST_F(TileManagerTilePriorityQueueTest, EvictionTilePriorityQueue) {
// Here we expect to get increasing PENDING_TREE priority_bin.
queue.Reset();
host_impl_.BuildEvictionQueue(&queue, NEW_CONTENT_TAKES_PRIORITY);
+ distance_decreasing = 0;
+ distance_increasing = 0;
while (!queue.IsEmpty()) {
Tile* tile = queue.Top();
EXPECT_TRUE(tile);
@@ -533,8 +542,11 @@ TEST_F(TileManagerTilePriorityQueueTest, EvictionTilePriorityQueue) {
tile->required_for_activation());
if (last_tile->required_for_activation() ==
tile->required_for_activation()) {
- EXPECT_GE(last_tile->priority(PENDING_TREE).distance_to_visible,
- tile->priority(PENDING_TREE).distance_to_visible);
+ if (last_tile->priority(PENDING_TREE).distance_to_visible >=
+ tile->priority(PENDING_TREE).distance_to_visible)
+ ++distance_decreasing;
+ else
+ ++distance_increasing;
}
}
@@ -543,6 +555,8 @@ TEST_F(TileManagerTilePriorityQueueTest, EvictionTilePriorityQueue) {
queue.Pop();
}
+ EXPECT_EQ(3, distance_increasing);
+ EXPECT_EQ(16, distance_decreasing);
EXPECT_EQ(tile_count, new_content_tiles.size());
EXPECT_EQ(all_tiles, new_content_tiles);
}

Powered by Google App Engine
This is Rietveld 408576698