Chromium Code Reviews| Index: cc/layers/picture_layer_impl_unittest.cc |
| diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc |
| index bd6a8f7f479f7fd466a466cfadcbf30597a07103..44662d7b2baaec06c2b980d211971ecbc7c7b3b1 100644 |
| --- a/cc/layers/picture_layer_impl_unittest.cc |
| +++ b/cc/layers/picture_layer_impl_unittest.cc |
| @@ -2498,6 +2498,11 @@ TEST_F(PictureLayerImplTest, HighResTilingDuringAnimationForGpuRasterization) { |
| } |
| TEST_F(PictureLayerImplTest, LayerRasterTileIterator) { |
| + base::TimeTicks time_ticks; |
| + time_ticks += base::TimeDelta::FromMilliseconds(1); |
| + host_impl_.SetCurrentBeginFrameArgs( |
| + CreateBeginFrameArgsForTesting(time_ticks)); |
| + |
| gfx::Size tile_size(100, 100); |
| gfx::Size layer_bounds(1000, 1000); |
| @@ -2563,6 +2568,45 @@ TEST_F(PictureLayerImplTest, LayerRasterTileIterator) { |
| EXPECT_EQ(low_res_tile_count + high_res_tile_count + non_ideal_tile_count, |
| unique_tiles.size()); |
| + // No NOW tiles. |
| + time_ticks += base::TimeDelta::FromMilliseconds(200); |
| + host_impl_.SetCurrentBeginFrameArgs( |
| + CreateBeginFrameArgsForTesting(time_ticks)); |
| + |
| + pending_layer_->draw_properties().visible_content_rect = |
|
vmpstr
2014/09/10 15:49:05
This works. I just wanted it to be a simple one li
|
| + gfx::Rect(1100, 1100, 500, 500); |
| + pending_layer_->UpdateTiles(NULL); |
| + |
| + unique_tiles.clear(); |
| + high_res_tile_count = 0u; |
| + for (it = PictureLayerImpl::LayerRasterTileIterator(pending_layer_, false); |
| + it; |
| + ++it) { |
| + Tile* tile = *it; |
| + TilePriority priority = tile->priority(PENDING_TREE); |
| + |
| + EXPECT_TRUE(tile); |
| + |
| + // Non-high res tiles only get visible tiles. |
| + EXPECT_EQ(HIGH_RESOLUTION, priority.resolution); |
| + EXPECT_NE(TilePriority::NOW, priority.priority_bin); |
| + |
| + high_res_tile_count += priority.resolution == HIGH_RESOLUTION; |
| + |
| + unique_tiles.insert(tile); |
| + } |
| + |
| + EXPECT_EQ(16u, high_res_tile_count); |
| + EXPECT_EQ(high_res_tile_count, unique_tiles.size()); |
| + |
| + time_ticks += base::TimeDelta::FromMilliseconds(200); |
| + host_impl_.SetCurrentBeginFrameArgs( |
| + CreateBeginFrameArgsForTesting(time_ticks)); |
| + |
| + pending_layer_->draw_properties().visible_content_rect = |
| + gfx::Rect(0, 0, 500, 500); |
| + pending_layer_->UpdateTiles(NULL); |
| + |
| std::vector<Tile*> high_res_tiles = high_res_tiling->AllTilesForTesting(); |
| for (std::vector<Tile*>::iterator tile_it = high_res_tiles.begin(); |
| tile_it != high_res_tiles.end(); |