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

Unified Diff: components/favicon/core/large_icon_service_unittest.cc

Issue 1122103003: [Large Icon Service] Move icon resizing into worker thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename Session to LargeIconWorker and move to anonymous namespace; use PostTaskAndReply(). Created 5 years, 7 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
Index: components/favicon/core/large_icon_service_unittest.cc
diff --git a/components/favicon/core/large_icon_service_unittest.cc b/components/favicon/core/large_icon_service_unittest.cc
index 48422ab55a39552a545d4d087af8528a9001bcfd..df7fcbd030b4209e31ebc4e79d146545ae084317 100644
--- a/components/favicon/core/large_icon_service_unittest.cc
+++ b/components/favicon/core/large_icon_service_unittest.cc
@@ -82,9 +82,9 @@ class MockFaviconService : public FaviconService {
}
private:
- DISALLOW_COPY_AND_ASSIGN(MockFaviconService);
-
std::deque<favicon_base::FaviconRawBitmapResult> mock_result_queue_;
+
+ DISALLOW_COPY_AND_ASSIGN(MockFaviconService);
};
// This class provides access to LargeIconService internals.
@@ -96,6 +96,11 @@ class TestLargeIconService : public LargeIconService {
~TestLargeIconService() override {
}
+ // Using the current thread's task runner for testing.
+ scoped_refptr<base::TaskRunner> GetBackgroundTaskRunner() override {
+ return base::MessageLoop::current()->task_runner();
+ }
+
private:
DISALLOW_COPY_AND_ASSIGN(TestLargeIconService);
};
@@ -152,7 +157,6 @@ class LargeIconServiceTest : public testing::Test {
};
TEST_F(LargeIconServiceTest, SameSize) {
-
mock_favicon_service_->InjectResult(CreateTestBitmap(24, 24, kTestColor));
expected_bitmap_ = CreateTestBitmap(24, 24, kTestColor);
large_icon_service_->GetLargeIconOrFallbackStyle(

Powered by Google App Engine
This is Rietveld 408576698