| OLD | NEW |
| 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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 MakeSuggestionsProviderWithoutInitialization() { | 421 MakeSuggestionsProviderWithoutInitialization() { |
| 422 scoped_refptr<base::SingleThreadTaskRunner> task_runner( | 422 scoped_refptr<base::SingleThreadTaskRunner> task_runner( |
| 423 base::ThreadTaskRunnerHandle::Get()); | 423 base::ThreadTaskRunnerHandle::Get()); |
| 424 scoped_refptr<net::TestURLRequestContextGetter> request_context_getter = | 424 scoped_refptr<net::TestURLRequestContextGetter> request_context_getter = |
| 425 new net::TestURLRequestContextGetter(task_runner.get()); | 425 new net::TestURLRequestContextGetter(task_runner.get()); |
| 426 | 426 |
| 427 utils_.ResetSigninManager(); | 427 utils_.ResetSigninManager(); |
| 428 auto suggestions_fetcher = base::MakeUnique<RemoteSuggestionsFetcher>( | 428 auto suggestions_fetcher = base::MakeUnique<RemoteSuggestionsFetcher>( |
| 429 utils_.fake_signin_manager(), /*token_service=*/nullptr, | 429 utils_.fake_signin_manager(), /*token_service=*/nullptr, |
| 430 std::move(request_context_getter), utils_.pref_service(), nullptr, | 430 std::move(request_context_getter), utils_.pref_service(), nullptr, |
| 431 base::Bind(&ParseJson), kAPIKey, &user_classifier_); | 431 base::Bind(&ParseJson), GetFetchEndpoint(version_info::Channel::STABLE), |
| 432 kAPIKey, &user_classifier_); |
| 432 suggestions_fetcher_ = suggestions_fetcher.get(); | 433 suggestions_fetcher_ = suggestions_fetcher.get(); |
| 433 | 434 |
| 434 auto image_fetcher = base::MakeUnique<NiceMock<MockImageFetcher>>(); | 435 auto image_fetcher = base::MakeUnique<NiceMock<MockImageFetcher>>(); |
| 435 | 436 |
| 436 image_fetcher_ = image_fetcher.get(); | 437 image_fetcher_ = image_fetcher.get(); |
| 437 EXPECT_CALL(*image_fetcher, SetImageFetcherDelegate(_)); | 438 EXPECT_CALL(*image_fetcher, SetImageFetcherDelegate(_)); |
| 438 auto image_decoder = base::MakeUnique<FakeImageDecoder>(); | 439 auto image_decoder = base::MakeUnique<FakeImageDecoder>(); |
| 439 image_decoder_ = image_decoder.get(); | 440 image_decoder_ = image_decoder.get(); |
| 440 EXPECT_FALSE(observer_); | 441 EXPECT_FALSE(observer_); |
| 441 observer_ = base::MakeUnique<FakeContentSuggestionsProviderObserver>(); | 442 observer_ = base::MakeUnique<FakeContentSuggestionsProviderObserver>(); |
| (...skipping 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1794 EXPECT_CALL(scheduler, OnProviderActivated()); | 1795 EXPECT_CALL(scheduler, OnProviderActivated()); |
| 1795 // The scheduler should be notified of clearing the history. | 1796 // The scheduler should be notified of clearing the history. |
| 1796 EXPECT_CALL(scheduler, OnSuggestionsCleared()); | 1797 EXPECT_CALL(scheduler, OnSuggestionsCleared()); |
| 1797 | 1798 |
| 1798 service->SetRemoteSuggestionsScheduler(&scheduler); | 1799 service->SetRemoteSuggestionsScheduler(&scheduler); |
| 1799 service->OnStatusChanged(RemoteSuggestionsStatus::ENABLED_AND_SIGNED_OUT, | 1800 service->OnStatusChanged(RemoteSuggestionsStatus::ENABLED_AND_SIGNED_OUT, |
| 1800 RemoteSuggestionsStatus::ENABLED_AND_SIGNED_IN); | 1801 RemoteSuggestionsStatus::ENABLED_AND_SIGNED_IN); |
| 1801 } | 1802 } |
| 1802 | 1803 |
| 1803 } // namespace ntp_snippets | 1804 } // namespace ntp_snippets |
| OLD | NEW |