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

Side by Side Diff: components/ntp_snippets/remote/remote_suggestions_provider_impl_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 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/ntp_snippets/remote/remote_suggestions_provider_impl.h" 5 #include "components/ntp_snippets/remote/remote_suggestions_provider_impl.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 } 331 }
332 } 332 }
333 333
334 // Factory for FakeURLFetcher objects that always generate errors. 334 // Factory for FakeURLFetcher objects that always generate errors.
335 class FailingFakeURLFetcherFactory : public net::URLFetcherFactory { 335 class FailingFakeURLFetcherFactory : public net::URLFetcherFactory {
336 public: 336 public:
337 std::unique_ptr<net::URLFetcher> CreateURLFetcher( 337 std::unique_ptr<net::URLFetcher> CreateURLFetcher(
338 int id, 338 int id,
339 const GURL& url, 339 const GURL& url,
340 net::URLFetcher::RequestType request_type, 340 net::URLFetcher::RequestType request_type,
341 net::URLFetcherDelegate* d) override { 341 net::URLFetcherDelegate* d,
342 net::NetworkTrafficAnnotationTag traffic_annotation) override {
342 return base::MakeUnique<net::FakeURLFetcher>( 343 return base::MakeUnique<net::FakeURLFetcher>(
343 url, d, /*response_data=*/std::string(), net::HTTP_NOT_FOUND, 344 url, d, /*response_data=*/std::string(), net::HTTP_NOT_FOUND,
344 net::URLRequestStatus::FAILED); 345 net::URLRequestStatus::FAILED);
345 } 346 }
346 }; 347 };
347 348
348 class MockImageFetcher : public ImageFetcher { 349 class MockImageFetcher : public ImageFetcher {
349 public: 350 public:
350 MOCK_METHOD1(SetImageFetcherDelegate, void(ImageFetcherDelegate*)); 351 MOCK_METHOD1(SetImageFetcherDelegate, void(ImageFetcherDelegate*));
351 MOCK_METHOD1(SetDataUseServiceName, void(DataUseServiceName)); 352 MOCK_METHOD1(SetDataUseServiceName, void(DataUseServiceName));
(...skipping 1556 matching lines...) Expand 10 before | Expand all | Expand 10 after
1908 WaitForSuggestionsProviderInitialization(service.get(), 1909 WaitForSuggestionsProviderInitialization(service.get(),
1909 /*set_empty_response=*/true); 1910 /*set_empty_response=*/true);
1910 1911
1911 // The scheduler should be notified of clearing the history. 1912 // The scheduler should be notified of clearing the history.
1912 EXPECT_CALL(*scheduler(), OnSuggestionsCleared()); 1913 EXPECT_CALL(*scheduler(), OnSuggestionsCleared());
1913 service->OnStatusChanged(RemoteSuggestionsStatus::ENABLED_AND_SIGNED_OUT, 1914 service->OnStatusChanged(RemoteSuggestionsStatus::ENABLED_AND_SIGNED_OUT,
1914 RemoteSuggestionsStatus::ENABLED_AND_SIGNED_IN); 1915 RemoteSuggestionsStatus::ENABLED_AND_SIGNED_IN);
1915 } 1916 }
1916 1917
1917 } // namespace ntp_snippets 1918 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698