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

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

Issue 2794343002: Network traffic annotation added to image_data_fetcher. (Closed)
Patch Set: Comments addressed. 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
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 1bbf63b0df848e4459d3595d87eb289dc5219224..596693b43615d5b5ed675106eda6be48f67c7822 100644
--- a/chrome/browser/chromeos/hats/hats_notification_controller_unittest.cc
+++ b/chrome/browser/chromeos/hats/hats_notification_controller_unittest.cc
@@ -23,6 +23,7 @@
#include "components/prefs/pref_service.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "content/public/test/test_utils.h"
+#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/image/image_unittest_util.h"
@@ -48,10 +49,11 @@ class MockImageFetcher : public image_fetcher::ImageFetcher {
MockImageFetcher() {}
~MockImageFetcher() override {}
- MOCK_METHOD3(StartOrQueueNetworkRequest,
+ MOCK_METHOD4(StartOrQueueNetworkRequest,
void(const std::string&,
const GURL&,
- const ImageFetcher::ImageFetcherCallback&));
+ const ImageFetcher::ImageFetcherCallback&,
+ const net::NetworkTrafficAnnotationTag&));
MOCK_METHOD1(SetImageFetcherDelegate, void(ImageFetcherDelegate*));
MOCK_METHOD1(SetDataUseServiceName, void(DataUseServiceName));
MOCK_METHOD1(SetImageDownloadLimit,
@@ -125,10 +127,11 @@ class HatsNotificationControllerTest : public BrowserWithTestWindowTest {
// Run the image fetcher callback to simulate a successful 1x icon fetch.
ON_CALL(*mock_image_fetcher_,
StartOrQueueNetworkRequest(
- HatsNotificationController::kImageFetcher1xId, _, _))
+ HatsNotificationController::kImageFetcher1xId, _, _, _))
.WillByDefault(Invoke([&hats_notification_controller](
const std::string&, const GURL&,
- const ImageFetcher::ImageFetcherCallback&) {
+ const ImageFetcher::ImageFetcherCallback&,
+ const net::NetworkTrafficAnnotationTag&) {
gfx::Image icon_1x(gfx::test::CreateImage());
hats_notification_controller->OnImageFetched(
HatsNotificationController::kImageFetcher1xId, icon_1x,
@@ -138,10 +141,11 @@ class HatsNotificationControllerTest : public BrowserWithTestWindowTest {
// Run the image fetcher callback to simulate a successful 2x icon fetch.
ON_CALL(*mock_image_fetcher_,
StartOrQueueNetworkRequest(
- HatsNotificationController::kImageFetcher2xId, _, _))
+ HatsNotificationController::kImageFetcher2xId, _, _, _))
.WillByDefault(Invoke([&hats_notification_controller](
const std::string&, const GURL&,
- ImageFetcher::ImageFetcherCallback) {
+ ImageFetcher::ImageFetcherCallback,
+ const net::NetworkTrafficAnnotationTag&) {
gfx::Image icon_1x(gfx::test::CreateImage());
hats_notification_controller->OnImageFetched(
HatsNotificationController::kImageFetcher2xId, icon_1x,
@@ -206,12 +210,12 @@ TEST_F(HatsNotificationControllerTest, OldDevice_ShouldShowNotification) {
EXPECT_CALL(*mock_image_fetcher_,
StartOrQueueNetworkRequest(
HatsNotificationController::kImageFetcher1xId,
- GURL(HatsNotificationController::kGoogleIcon1xUrl), _))
+ GURL(HatsNotificationController::kGoogleIcon1xUrl), _, _))
.Times(1);
EXPECT_CALL(*mock_image_fetcher_,
StartOrQueueNetworkRequest(
HatsNotificationController::kImageFetcher2xId,
- GURL(HatsNotificationController::kGoogleIcon2xUrl), _))
+ GURL(HatsNotificationController::kGoogleIcon2xUrl), _, _))
.Times(1);
hats_notification_controller->Initialize(false);

Powered by Google App Engine
This is Rietveld 408576698