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

Side by Side Diff: ios/chrome/browser/ui/history/favicon_view_provider_unittest.mm

Issue 2721363002: Extend LargeIconService to fetch missing favicons from a Google server (Closed)
Patch Set: Add fallback_opts=TYPE Created 3 years, 9 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 #import "ios/chrome/browser/ui/history/favicon_view_provider.h" 5 #import "ios/chrome/browser/ui/history/favicon_view_provider.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 CHECK(result.is_valid()); 73 CHECK(result.is_valid());
74 return result; 74 return result;
75 } 75 }
76 76
77 class FaviconViewProviderTest : public PlatformTest { 77 class FaviconViewProviderTest : public PlatformTest {
78 protected: 78 protected:
79 void SetUp() override { 79 void SetUp() override {
80 DCHECK_CURRENTLY_ON(web::WebThread::UI); 80 DCHECK_CURRENTLY_ON(web::WebThread::UI);
81 PlatformTest::SetUp(); 81 PlatformTest::SetUp();
82 large_icon_service_.reset(new favicon::LargeIconService( 82 large_icon_service_.reset(new favicon::LargeIconService(
83 &mock_favicon_service_, base::ThreadTaskRunnerHandle::Get())); 83 &mock_favicon_service_, base::ThreadTaskRunnerHandle::Get(),
84 /*image_fetcher=*/nullptr));
84 85
85 EXPECT_CALL(mock_favicon_service_, GetLargestRawFaviconForPageURL( 86 EXPECT_CALL(mock_favicon_service_, GetLargestRawFaviconForPageURL(
86 GURL(kTestFaviconURL), _, _, _, _)) 87 GURL(kTestFaviconURL), _, _, _, _))
87 .WillRepeatedly(PostReply<5>(CreateTestBitmap())); 88 .WillRepeatedly(PostReply<5>(CreateTestBitmap()));
88 } 89 }
89 90
90 web::TestWebThreadBundle thread_bundle_; 91 web::TestWebThreadBundle thread_bundle_;
91 testing::StrictMock<favicon::MockFaviconService> mock_favicon_service_; 92 testing::StrictMock<favicon::MockFaviconService> mock_favicon_service_;
92 std::unique_ptr<favicon::LargeIconService> large_icon_service_; 93 std::unique_ptr<favicon::LargeIconService> large_icon_service_;
93 base::CancelableTaskTracker cancelable_task_tracker_; 94 base::CancelableTaskTracker cancelable_task_tracker_;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 EXPECT_NSEQ(defaultText, viewProvider.fallbackText); 144 EXPECT_NSEQ(defaultText, viewProvider.fallbackText);
144 EXPECT_NSEQ(defaultTextColor, viewProvider.fallbackTextColor); 145 EXPECT_NSEQ(defaultTextColor, viewProvider.fallbackTextColor);
145 EXPECT_NSEQ(defaultBackgroundColor, viewProvider.fallbackBackgroundColor); 146 EXPECT_NSEQ(defaultBackgroundColor, viewProvider.fallbackBackgroundColor);
146 }; 147 };
147 [[[mock_delegate stub] andDo:confirmationBlock] 148 [[[mock_delegate stub] andDo:confirmationBlock]
148 faviconViewProviderFaviconDidLoad:item]; 149 faviconViewProviderFaviconDidLoad:item];
149 EXPECT_OCMOCK_VERIFY(mock_delegate); 150 EXPECT_OCMOCK_VERIFY(mock_delegate);
150 } 151 }
151 152
152 } // namespace 153 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698