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

Unified Diff: cc/tiles/image_controller_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
« cc/tiles/image_controller.cc ('K') | « cc/tiles/image_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/image_controller_unittest.cc
diff --git a/cc/tiles/image_controller_unittest.cc b/cc/tiles/image_controller_unittest.cc
index ddd537617a2a4cc5d891466d344dbdfa9081ed97..8b3fffdd08d0432760b11c34d40dba6c9c6c0019 100644
--- a/cc/tiles/image_controller_unittest.cc
+++ b/cc/tiles/image_controller_unittest.cc
@@ -2,12 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "cc/tiles/image_controller.h"
#include "base/bind.h"
#include "base/optional.h"
#include "base/run_loop.h"
#include "base/test/test_simple_task_runner.h"
#include "base/threading/sequenced_task_runner_handle.h"
-#include "cc/tiles/image_controller.h"
+#include "cc/test/skia_common.h"
#include "cc/tiles/image_decode_cache.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -132,7 +133,8 @@ class DecodeClient {
public:
DecodeClient() {}
void Callback(const base::Closure& quit_closure,
- ImageController::ImageDecodeRequestId id) {
+ ImageController::ImageDecodeRequestId id,
+ ImageController::ImageDecodeResult result) {
id_ = id;
quit_closure.Run();
}
@@ -218,8 +220,7 @@ int kDefaultTimeoutSeconds = 10;
class ImageControllerTest : public testing::Test {
public:
ImageControllerTest() : task_runner_(base::SequencedTaskRunnerHandle::Get()) {
- bitmap_.allocN32Pixels(1, 1);
- image_ = SkImage::MakeFromBitmap(bitmap_);
+ image_ = CreateDiscardableImage(gfx::Size(1, 1));
}
~ImageControllerTest() override = default;
@@ -261,7 +262,6 @@ class ImageControllerTest : public testing::Test {
scoped_refptr<WorkerTaskRunner> worker_task_runner_;
TestableCache cache_;
std::unique_ptr<ImageController> controller_;
- SkBitmap bitmap_;
sk_sp<const SkImage> image_;
};
« cc/tiles/image_controller.cc ('K') | « cc/tiles/image_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698