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/ntp_snippets_status_service.h" | 5 #include "components/ntp_snippets/ntp_snippets_status_service.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "components/ntp_snippets/ntp_snippets_test_utils.h" | 9 #include "components/ntp_snippets/ntp_snippets_test_utils.h" |
10 #include "components/ntp_snippets/pref_names.h" | 10 #include "components/ntp_snippets/pref_names.h" |
11 #include "components/prefs/pref_registry_simple.h" | 11 #include "components/prefs/pref_registry_simple.h" |
12 #include "components/prefs/testing_pref_service.h" | 12 #include "components/prefs/testing_pref_service.h" |
13 #include "components/signin/core/browser/account_tracker_service.h" | 13 #include "components/signin/core/browser/account_tracker_service.h" |
14 #include "components/signin/core/browser/fake_signin_manager.h" | 14 #include "components/signin/core/browser/fake_signin_manager.h" |
15 #include "components/signin/core/browser/test_signin_client.h" | 15 #include "components/signin/core/browser/test_signin_client.h" |
16 #include "components/signin/core/common/signin_pref_names.h" | 16 #include "components/signin/core/common/signin_pref_names.h" |
17 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 | 19 |
20 using testing::Return; | |
21 | |
22 namespace ntp_snippets { | 20 namespace ntp_snippets { |
23 | 21 |
24 class NTPSnippetsStatusServiceTest : public ::testing::Test { | 22 class NTPSnippetsStatusServiceTest : public ::testing::Test { |
25 public: | 23 public: |
26 NTPSnippetsStatusServiceTest() { | 24 NTPSnippetsStatusServiceTest() { |
27 NTPSnippetsStatusService::RegisterProfilePrefs( | 25 NTPSnippetsStatusService::RegisterProfilePrefs( |
28 utils_.pref_service()->registry()); | 26 utils_.pref_service()->registry()); |
29 } | 27 } |
30 | 28 |
31 std::unique_ptr<NTPSnippetsStatusService> MakeService() { | 29 std::unique_ptr<NTPSnippetsStatusService> MakeService() { |
(...skipping 19 matching lines...) Expand all Loading... |
51 EXPECT_EQ(DisabledReason::EXPLICITLY_DISABLED, | 49 EXPECT_EQ(DisabledReason::EXPLICITLY_DISABLED, |
52 service->GetDisabledReasonFromDeps()); | 50 service->GetDisabledReasonFromDeps()); |
53 | 51 |
54 // Signing-in shouldn't matter anymore. | 52 // Signing-in shouldn't matter anymore. |
55 utils_.fake_signin_manager()->SignIn("foo@bar.com"); | 53 utils_.fake_signin_manager()->SignIn("foo@bar.com"); |
56 EXPECT_EQ(DisabledReason::EXPLICITLY_DISABLED, | 54 EXPECT_EQ(DisabledReason::EXPLICITLY_DISABLED, |
57 service->GetDisabledReasonFromDeps()); | 55 service->GetDisabledReasonFromDeps()); |
58 } | 56 } |
59 | 57 |
60 } // namespace ntp_snippets | 58 } // namespace ntp_snippets |
OLD | NEW |