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

Side by Side Diff: components/ntp_tiles/icon_cacher_impl_unittest.cc

Issue 2347173002: Extend FaviconService to support fetching favicons from a Google server (Closed)
Patch Set: Peter's comments #2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/ntp_tiles/icon_cacher_impl.h" 5 #include "components/ntp_tiles/icon_cacher_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 class IconCacherTest : public ::testing::Test { 44 class IconCacherTest : public ::testing::Test {
45 protected: 45 protected:
46 IconCacherTest() 46 IconCacherTest()
47 : site_(base::string16(), // title, unused 47 : site_(base::string16(), // title, unused
48 GURL("http://url.google/"), 48 GURL("http://url.google/"),
49 GURL("http://url.google/icon.png"), 49 GURL("http://url.google/icon.png"),
50 GURL("http://url.google/favicon.ico"), 50 GURL("http://url.google/favicon.ico"),
51 GURL()), // thumbnail, unused 51 GURL()), // thumbnail, unused
52 image_fetcher_(new ::testing::StrictMock<MockImageFetcher>), 52 image_fetcher_(new ::testing::StrictMock<MockImageFetcher>),
53 favicon_service_(/*favicon_client=*/nullptr, &history_service_) { 53 favicon_service_(/*favicon_client=*/nullptr,
54 &history_service_,
55 nullptr) {
54 CHECK(history_dir_.CreateUniqueTempDir()); 56 CHECK(history_dir_.CreateUniqueTempDir());
55 CHECK(history_service_.Init( 57 CHECK(history_service_.Init(
56 history::HistoryDatabaseParams(history_dir_.GetPath(), 0, 0))); 58 history::HistoryDatabaseParams(history_dir_.GetPath(), 0, 0)));
57 } 59 }
58 60
59 void PreloadIcon(const GURL& url, 61 void PreloadIcon(const GURL& url,
60 const GURL& icon_url, 62 const GURL& icon_url,
61 favicon_base::IconType icon_type, 63 favicon_base::IconType icon_type,
62 int width, 64 int width,
63 int height) { 65 int height) {
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 192
191 IconCacherImpl cacher(&favicon_service_, std::move(image_fetcher_)); 193 IconCacherImpl cacher(&favicon_service_, std::move(image_fetcher_));
192 cacher.StartFetch(site_, BindMockFunction(&done)); 194 cacher.StartFetch(site_, BindMockFunction(&done));
193 loop.Run(); 195 loop.Run();
194 EXPECT_FALSE(IconIsCachedFor(site_.url, favicon_base::FAVICON)); 196 EXPECT_FALSE(IconIsCachedFor(site_.url, favicon_base::FAVICON));
195 EXPECT_FALSE(IconIsCachedFor(site_.url, favicon_base::TOUCH_ICON)); 197 EXPECT_FALSE(IconIsCachedFor(site_.url, favicon_base::TOUCH_ICON));
196 } 198 }
197 199
198 } // namespace 200 } // namespace
199 } // namespace ntp_tiles 201 } // namespace ntp_tiles
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698