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

Unified Diff: cc/tiles/checker_image_tracker_unittest.cc

Issue 2927573003: cc: Disallow img.decode images from being checker imaged. (Closed)
Patch Set: update Created 3 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
« no previous file with comments | « cc/tiles/checker_image_tracker.cc ('k') | cc/tiles/tile_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/checker_image_tracker_unittest.cc
diff --git a/cc/tiles/checker_image_tracker_unittest.cc b/cc/tiles/checker_image_tracker_unittest.cc
index 38de60dfd80b7797c99004c3e25dd0edc453157a..7a08e9cf7097f10dea8b3d2802a05ab72ad60d64 100644
--- a/cc/tiles/checker_image_tracker_unittest.cc
+++ b/cc/tiles/checker_image_tracker_unittest.cc
@@ -416,5 +416,26 @@ TEST_F(CheckerImageTrackerTest, CheckersOnlyStaticCompletedImages) {
completed_paint_image, WhichTree::PENDING_TREE));
}
+TEST_F(CheckerImageTrackerTest, DontCheckerDisallowedImages) {
+ SetUpTracker(true);
+
+ PaintImage image = CreateImage(ImageType::CHECKERABLE);
+ EXPECT_TRUE(checker_image_tracker_->ShouldCheckerImage(
+ image, WhichTree::PENDING_TREE));
+ checker_image_tracker_->DisallowCheckeringForImage(image);
+ // Since the tracker already saw the image, even disallowing it would still
+ // ensure that we checker it until it's completed.
+ EXPECT_TRUE(checker_image_tracker_->ShouldCheckerImage(
+ image, WhichTree::PENDING_TREE));
+
+ // Reset the tracker.
+ checker_image_tracker_->ClearTracker(true);
+ // If we haven't seen the image and disallow it first, then it's not
+ // checkerable anymore.
+ checker_image_tracker_->DisallowCheckeringForImage(image);
+ EXPECT_FALSE(checker_image_tracker_->ShouldCheckerImage(
+ image, WhichTree::PENDING_TREE));
+}
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/tiles/checker_image_tracker.cc ('k') | cc/tiles/tile_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698