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

Unified Diff: components/ntp_snippets/remote/remote_suggestions_fetcher_unittest.cc

Issue 2890293005: Network traffic annotation stored in url_request. (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
Index: components/ntp_snippets/remote/remote_suggestions_fetcher_unittest.cc
diff --git a/components/ntp_snippets/remote/remote_suggestions_fetcher_unittest.cc b/components/ntp_snippets/remote/remote_suggestions_fetcher_unittest.cc
index 7607efe00ca917238e9ab9099f052bf6a4d7f33c..e5ffb4d0821e3b5ccc297d563065676c3bdb6b4a 100644
--- a/components/ntp_snippets/remote/remote_suggestions_fetcher_unittest.cc
+++ b/components/ntp_snippets/remote/remote_suggestions_fetcher_unittest.cc
@@ -30,6 +30,7 @@
#include "components/variations/entropy_provider.h"
#include "components/variations/variations_params_manager.h"
#include "google_apis/gaia/fake_oauth2_token_service_delegate.h"
+#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "net/url_request/test_url_fetcher_factory.h"
#include "net/url_request/url_request_test_util.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -182,14 +183,16 @@ class DelegateCallingTestURLFetcherFactory
int id,
const GURL& url,
net::URLFetcher::RequestType request_type,
- net::URLFetcherDelegate* d) override {
+ net::URLFetcherDelegate* d,
+ net::NetworkTrafficAnnotationTag traffic_annotation) override {
if (GetFetcherByID(id)) {
LOG(WARNING) << "The ID " << id << " was already assigned to a fetcher."
<< "Its delegate will thereforde be called right now.";
DropAndCallDelegate(id);
}
fetchers_.push_back(id);
- return TestURLFetcherFactory::CreateURLFetcher(id, url, request_type, d);
+ return TestURLFetcherFactory::CreateURLFetcher(id, url, request_type, d,
+ traffic_annotation);
}
// Returns the raw pointer of the last created URL fetcher.
@@ -235,7 +238,8 @@ class FailingFakeURLFetcherFactory : public net::URLFetcherFactory {
int id,
const GURL& url,
net::URLFetcher::RequestType request_type,
- net::URLFetcherDelegate* d) override {
+ net::URLFetcherDelegate* d,
+ net::NetworkTrafficAnnotationTag traffic_annotation) override {
return base::MakeUnique<net::FakeURLFetcher>(
url, d, /*response_data=*/std::string(), net::HTTP_NOT_FOUND,
net::URLRequestStatus::FAILED);

Powered by Google App Engine
This is Rietveld 408576698