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

Unified Diff: chrome/browser/chromeos/hats/hats_notification_controller_unittest.cc

Issue 2757643002: components/image_fetcher: Expose RequestMetadata from ImageFetcher (Closed)
Patch Set: logo_bridge 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/hats/hats_notification_controller_unittest.cc
diff --git a/chrome/browser/chromeos/hats/hats_notification_controller_unittest.cc b/chrome/browser/chromeos/hats/hats_notification_controller_unittest.cc
index b8f32d1e5734457767323ab687c87fdddcc2ef0f..5387d81f8f3796a1bf8524931544e4a4dd0b6ec5 100644
--- a/chrome/browser/chromeos/hats/hats_notification_controller_unittest.cc
+++ b/chrome/browser/chromeos/hats/hats_notification_controller_unittest.cc
@@ -16,6 +16,7 @@
#include "chromeos/network/portal_detector/network_portal_detector.h"
#include "components/image_fetcher/image_fetcher.h"
#include "components/image_fetcher/image_fetcher_delegate.h"
+#include "components/image_fetcher/request_metadata.h"
#include "components/prefs/pref_service.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "content/public/test/test_utils.h"
@@ -32,6 +33,7 @@ using testing::Return;
using testing::SaveArg;
using testing::StrictMock;
+using image_fetcher::ImageFetcher;
using image_fetcher::ImageFetcherDelegate;
namespace chromeos {
@@ -68,11 +70,10 @@ class MockImageFetcher : public image_fetcher::ImageFetcher {
MockImageFetcher() {}
~MockImageFetcher() override {}
- MOCK_METHOD3(
- StartOrQueueNetworkRequest,
- void(const std::string&,
- const GURL&,
- base::Callback<void(const std::string&, const gfx::Image&)>));
+ MOCK_METHOD3(StartOrQueueNetworkRequest,
+ void(const std::string&,
+ const GURL&,
+ const ImageFetcher::ImageFetcherCallback&));
MOCK_METHOD1(SetImageFetcherDelegate, void(ImageFetcherDelegate*));
MOCK_METHOD1(SetDataUseServiceName, void(DataUseServiceName));
MOCK_METHOD1(SetDesiredImageFrameSize, void(const gfx::Size&));
@@ -143,11 +144,12 @@ class HatsNotificationControllerTest : public BrowserWithTestWindowTest {
StartOrQueueNetworkRequest(
HatsNotificationController::kImageFetcher1xId, _, _))
.WillByDefault(Invoke([&hats_notification_controller](
- const std::string&, const GURL&,
- base::Callback<void(const std::string&, const gfx::Image&)>) {
+ const std::string&, const GURL&,
+ const ImageFetcher::ImageFetcherCallback&) {
gfx::Image icon_1x(gfx::test::CreateImage());
hats_notification_controller->OnImageFetched(
- HatsNotificationController::kImageFetcher1xId, icon_1x);
+ HatsNotificationController::kImageFetcher1xId, icon_1x,
+ image_fetcher::RequestMetadata());
}));
// Run the image fetcher callback to simulate a successful 2x icon fetch.
@@ -155,11 +157,12 @@ class HatsNotificationControllerTest : public BrowserWithTestWindowTest {
StartOrQueueNetworkRequest(
HatsNotificationController::kImageFetcher2xId, _, _))
.WillByDefault(Invoke([&hats_notification_controller](
- const std::string&, const GURL&,
- base::Callback<void(const std::string&, const gfx::Image&)>) {
+ const std::string&, const GURL&,
+ ImageFetcher::ImageFetcherCallback) {
gfx::Image icon_1x(gfx::test::CreateImage());
hats_notification_controller->OnImageFetched(
- HatsNotificationController::kImageFetcher2xId, icon_1x);
+ HatsNotificationController::kImageFetcher2xId, icon_1x,
+ image_fetcher::RequestMetadata());
}));
return hats_notification_controller;

Powered by Google App Engine
This is Rietveld 408576698