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

Unified Diff: cc/tiles/decoded_image_tracker_unittest.cc

Issue 2703633004: cc: Make image controller return a status with the callback. (Closed)
Patch Set: update Created 3 years, 10 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/decoded_image_tracker.cc ('k') | cc/tiles/image_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/decoded_image_tracker_unittest.cc
diff --git a/cc/tiles/decoded_image_tracker_unittest.cc b/cc/tiles/decoded_image_tracker_unittest.cc
index eff5f18e392021f97ec4aaa7614d55d5cf435357..54a08ba223560652559ecb561f1dbd11c635e184 100644
--- a/cc/tiles/decoded_image_tracker_unittest.cc
+++ b/cc/tiles/decoded_image_tracker_unittest.cc
@@ -26,7 +26,7 @@ class TestImageController : public ImageController {
const ImageDecodedCallback& callback) override {
auto id = next_id_++;
locked_ids_.push_back(id);
- callback.Run(id);
+ callback.Run(id, ImageDecodeResult::SUCCESS);
return id;
}
@@ -56,8 +56,9 @@ class DecodedImageTrackerTest : public testing::Test {
TEST_F(DecodedImageTrackerTest, QueueImageLocksImages) {
bool locked = false;
decoded_image_tracker()->QueueImageDecode(
- nullptr, base::Bind([](bool* locked) { *locked = true; },
- base::Unretained(&locked)));
+ nullptr,
+ base::Bind([](bool* locked, bool success) { *locked = true; },
+ base::Unretained(&locked)));
EXPECT_TRUE(locked);
EXPECT_EQ(1u, image_controller()->num_locked_images());
}
@@ -65,8 +66,9 @@ TEST_F(DecodedImageTrackerTest, QueueImageLocksImages) {
TEST_F(DecodedImageTrackerTest, NotifyFrameFinishedUnlocksImages) {
bool locked = false;
decoded_image_tracker()->QueueImageDecode(
- nullptr, base::Bind([](bool* locked) { *locked = true; },
- base::Unretained(&locked)));
+ nullptr,
+ base::Bind([](bool* locked, bool success) { *locked = true; },
+ base::Unretained(&locked)));
EXPECT_TRUE(locked);
EXPECT_EQ(1u, image_controller()->num_locked_images());
@@ -75,8 +77,9 @@ TEST_F(DecodedImageTrackerTest, NotifyFrameFinishedUnlocksImages) {
locked = false;
decoded_image_tracker()->QueueImageDecode(
- nullptr, base::Bind([](bool* locked) { *locked = true; },
- base::Unretained(&locked)));
+ nullptr,
+ base::Bind([](bool* locked, bool success) { *locked = true; },
+ base::Unretained(&locked)));
EXPECT_TRUE(locked);
EXPECT_EQ(2u, image_controller()->num_locked_images());
« no previous file with comments | « cc/tiles/decoded_image_tracker.cc ('k') | cc/tiles/image_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698