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

Side by Side Diff: components/favicon/core/large_icon_service_unittest.cc

Issue 2781473003: Add |SetImageDownloadLimit| to ImageFetcher to limit downloaded bytes (Closed)
Patch Set: Add |SetImageDownloadLimit| to ImageDataFetcher 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/favicon/core/large_icon_service.h" 5 #include "components/favicon/core/large_icon_service.h"
6 6
7 #include <deque> 7 #include <deque>
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 CHECK(result.is_valid()); 80 CHECK(result.is_valid());
81 return result; 81 return result;
82 } 82 }
83 83
84 class MockImageFetcher : public image_fetcher::ImageFetcher { 84 class MockImageFetcher : public image_fetcher::ImageFetcher {
85 public: 85 public:
86 MOCK_METHOD1(SetImageFetcherDelegate, 86 MOCK_METHOD1(SetImageFetcherDelegate,
87 void(image_fetcher::ImageFetcherDelegate* delegate)); 87 void(image_fetcher::ImageFetcherDelegate* delegate));
88 MOCK_METHOD1(SetDataUseServiceName, 88 MOCK_METHOD1(SetDataUseServiceName,
89 void(image_fetcher::ImageFetcher::DataUseServiceName name)); 89 void(image_fetcher::ImageFetcher::DataUseServiceName name));
90 MOCK_METHOD1(SetImageDownloadLimit, void(int64_t max_download_bytes));
90 MOCK_METHOD1(SetDesiredImageFrameSize, void(const gfx::Size& size)); 91 MOCK_METHOD1(SetDesiredImageFrameSize, void(const gfx::Size& size));
91 MOCK_METHOD3(StartOrQueueNetworkRequest, 92 MOCK_METHOD3(StartOrQueueNetworkRequest,
92 void(const std::string&, 93 void(const std::string&,
93 const GURL&, 94 const GURL&,
94 const ImageFetcherCallback&)); 95 const ImageFetcherCallback&));
95 MOCK_METHOD0(GetImageDecoder, image_fetcher::ImageDecoder*()); 96 MOCK_METHOD0(GetImageDecoder, image_fetcher::ImageDecoder*());
96 }; 97 };
97 98
98 class LargeIconServiceTest : public testing::Test { 99 class LargeIconServiceTest : public testing::Test {
99 public: 100 public:
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 large_icon_service_ 374 large_icon_service_
374 .GetLargeIconOrFallbackStyleFromGoogleServerSkippingLocalCache( 375 .GetLargeIconOrFallbackStyleFromGoogleServerSkippingLocalCache(
375 GURL(kDummyUrl), /*min_source_size_in_pixel=*/42, callback.Get()); 376 GURL(kDummyUrl), /*min_source_size_in_pixel=*/42, callback.Get());
376 377
377 EXPECT_CALL(callback, Run(false)); 378 EXPECT_CALL(callback, Run(false));
378 base::RunLoop().RunUntilIdle(); 379 base::RunLoop().RunUntilIdle();
379 } 380 }
380 381
381 } // namespace 382 } // namespace
382 } // namespace favicon 383 } // namespace favicon
OLDNEW
« no previous file with comments | « no previous file | components/image_fetcher/core/image_data_fetcher.h » ('j') | components/image_fetcher/core/image_data_fetcher.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698