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

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

Issue 2866133002: Add EXPECT_CALL to fix warning during unit_test run for Hats (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 cc69995ddde973342e454e8ebc65164c4f82bec9..6486c88e183cb4b1b7289e8f6cb001be83ac19dd 100644
--- a/chrome/browser/chromeos/hats/hats_notification_controller_unittest.cc
+++ b/chrome/browser/chromeos/hats/hats_notification_controller_unittest.cc
@@ -123,7 +123,7 @@ class HatsNotificationControllerTest : public BrowserWithTestWindowTest {
}
scoped_refptr<HatsNotificationController> InstantiateHatsController() {
- MockImageFetcher* mock_image_fetcher_ = new MockImageFetcher;
+ mock_image_fetcher_ = new MockImageFetcher;
// The initialization will fail since the function IsNewDevice() will return
// true.
scoped_refptr<HatsNotificationController> hats_notification_controller =
@@ -177,6 +177,7 @@ class HatsNotificationControllerTest : public BrowserWithTestWindowTest {
TestingProfile profile_;
StrictMock<MockNetworkPortalDetector> mock_network_portal_detector_;
+ MockImageFetcher* mock_image_fetcher_;
private:
std::unique_ptr<TestingProfileManager> profile_manager_;
@@ -226,6 +227,17 @@ TEST_F(HatsNotificationControllerTest, OldDevice_ShouldShowNotification) {
RemoveObserver(hats_notification_controller.get()))
.Times(2);
+ EXPECT_CALL(*mock_image_fetcher_,
+ StartOrQueueNetworkRequest(
+ HatsNotificationController::kImageFetcher1xId,
+ GURL(HatsNotificationController::kGoogleIcon1xUrl), _))
+ .Times(1);
+ EXPECT_CALL(*mock_image_fetcher_,
+ StartOrQueueNetworkRequest(
+ HatsNotificationController::kImageFetcher2xId,
+ GURL(HatsNotificationController::kGoogleIcon2xUrl), _))
+ .Times(1);
+
hats_notification_controller->Initialize(false);
// Finally check if notification was launched to confirm initialization.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698