| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_fetcher.h" | 5 #include "components/ntp_snippets/remote/remote_suggestions_fetcher.h" |
| 6 | 6 |
| 7 #include <deque> | 7 #include <deque> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 }; | 392 }; |
| 393 | 393 |
| 394 class RemoteSuggestionsSignedOutFetcherTest | 394 class RemoteSuggestionsSignedOutFetcherTest |
| 395 : public RemoteSuggestionsFetcherTestBase { | 395 : public RemoteSuggestionsFetcherTestBase { |
| 396 public: | 396 public: |
| 397 RemoteSuggestionsSignedOutFetcherTest() | 397 RemoteSuggestionsSignedOutFetcherTest() |
| 398 : RemoteSuggestionsFetcherTestBase( | 398 : RemoteSuggestionsFetcherTestBase( |
| 399 GURL(kTestChromeContentSuggestionsSignedOutUrl)) {} | 399 GURL(kTestChromeContentSuggestionsSignedOutUrl)) {} |
| 400 }; | 400 }; |
| 401 | 401 |
| 402 // TODO(jkrcal): Add unit-tests for the "authentication in progress" case as it | 402 // TODO(jkrcal): Investigate whether the "authentication in progress" case can |
| 403 // requires more changes (instead FakeSigninManagerBase use FakeSigninManager | 403 // ever happen (see discussion on https://codereview.chromium.org/2582573002), |
| 404 // which does not exist on ChromeOS). crbug.com/688310 | 404 // and if so, add unit-tests for it. This will require more changes (instead of |
| 405 // FakeSigninManagerBase use FakeSigninManager which does not exist on |
| 406 // ChromeOS). crbug.com/688310 |
| 405 class RemoteSuggestionsSignedInFetcherTest | 407 class RemoteSuggestionsSignedInFetcherTest |
| 406 : public RemoteSuggestionsFetcherTestBase { | 408 : public RemoteSuggestionsFetcherTestBase { |
| 407 public: | 409 public: |
| 408 RemoteSuggestionsSignedInFetcherTest() | 410 RemoteSuggestionsSignedInFetcherTest() |
| 409 : RemoteSuggestionsFetcherTestBase( | 411 : RemoteSuggestionsFetcherTestBase( |
| 410 GURL(kTestChromeContentSuggestionsSignedInUrl)) {} | 412 GURL(kTestChromeContentSuggestionsSignedInUrl)) {} |
| 411 }; | 413 }; |
| 412 | 414 |
| 413 TEST_F(RemoteSuggestionsSignedOutFetcherTest, ShouldNotFetchOnCreation) { | 415 TEST_F(RemoteSuggestionsSignedOutFetcherTest, ShouldNotFetchOnCreation) { |
| 414 // The lack of registered baked in responses would cause any fetch to fail. | 416 // The lack of registered baked in responses would cause any fetch to fail. |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 fetched_categories) { | 991 fetched_categories) { |
| 990 if (fetched_categories) { | 992 if (fetched_categories) { |
| 991 // Matchers above aren't any more precise than this, so this is sufficient | 993 // Matchers above aren't any more precise than this, so this is sufficient |
| 992 // for test-failure diagnostics. | 994 // for test-failure diagnostics. |
| 993 return os << "list with " << fetched_categories->size() << " elements"; | 995 return os << "list with " << fetched_categories->size() << " elements"; |
| 994 } | 996 } |
| 995 return os << "null"; | 997 return os << "null"; |
| 996 } | 998 } |
| 997 | 999 |
| 998 } // namespace ntp_snippets | 1000 } // namespace ntp_snippets |
| OLD | NEW |