OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "base/test/histogram_tester.h" | 9 #include "base/test/histogram_tester.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 class MockAccountReconcilor : public testing::StrictMock<AccountReconcilor> { | 41 class MockAccountReconcilor : public testing::StrictMock<AccountReconcilor> { |
42 public: | 42 public: |
43 static KeyedService* Build(content::BrowserContext* context); | 43 static KeyedService* Build(content::BrowserContext* context); |
44 | 44 |
45 MockAccountReconcilor(ProfileOAuth2TokenService* token_service, | 45 MockAccountReconcilor(ProfileOAuth2TokenService* token_service, |
46 SigninManagerBase* signin_manager, | 46 SigninManagerBase* signin_manager, |
47 SigninClient* client); | 47 SigninClient* client); |
48 virtual ~MockAccountReconcilor() {} | 48 virtual ~MockAccountReconcilor() {} |
49 | 49 |
50 virtual void StartFetchingExternalCcResult() OVERRIDE { | 50 virtual void StartFetchingExternalCcResult() override { |
51 // Don't do this in tests. | 51 // Don't do this in tests. |
52 } | 52 } |
53 | 53 |
54 MOCK_METHOD1(PerformMergeAction, void(const std::string& account_id)); | 54 MOCK_METHOD1(PerformMergeAction, void(const std::string& account_id)); |
55 MOCK_METHOD0(PerformLogoutAllAccountsAction, void()); | 55 MOCK_METHOD0(PerformLogoutAllAccountsAction, void()); |
56 }; | 56 }; |
57 | 57 |
58 // static | 58 // static |
59 KeyedService* MockAccountReconcilor::Build(content::BrowserContext* context) { | 59 KeyedService* MockAccountReconcilor::Build(content::BrowserContext* context) { |
60 Profile* profile = Profile::FromBrowserContext(context); | 60 Profile* profile = Profile::FromBrowserContext(context); |
(...skipping 11 matching lines...) Expand all Loading... |
72 SigninClient* client) | 72 SigninClient* client) |
73 : testing::StrictMock<AccountReconcilor>(token_service, | 73 : testing::StrictMock<AccountReconcilor>(token_service, |
74 signin_manager, | 74 signin_manager, |
75 client) {} | 75 client) {} |
76 | 76 |
77 } // namespace | 77 } // namespace |
78 | 78 |
79 class AccountReconcilorTest : public ::testing::TestWithParam<bool> { | 79 class AccountReconcilorTest : public ::testing::TestWithParam<bool> { |
80 public: | 80 public: |
81 AccountReconcilorTest(); | 81 AccountReconcilorTest(); |
82 virtual void SetUp() OVERRIDE; | 82 virtual void SetUp() override; |
83 | 83 |
84 TestingProfile* profile() { return profile_; } | 84 TestingProfile* profile() { return profile_; } |
85 FakeSigninManagerForTesting* signin_manager() { return signin_manager_; } | 85 FakeSigninManagerForTesting* signin_manager() { return signin_manager_; } |
86 FakeProfileOAuth2TokenService* token_service() { return token_service_; } | 86 FakeProfileOAuth2TokenService* token_service() { return token_service_; } |
87 base::HistogramTester* histogram_tester() { return &histogram_tester_; } | 87 base::HistogramTester* histogram_tester() { return &histogram_tester_; } |
88 | 88 |
89 void SetFakeResponse(const std::string& url, | 89 void SetFakeResponse(const std::string& url, |
90 const std::string& data, | 90 const std::string& data, |
91 net::HttpStatusCode code, | 91 net::HttpStatusCode code, |
92 net::URLRequestStatus::Status status) { | 92 net::URLRequestStatus::Status status) { |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 | 601 |
602 SimulateMergeSessionCompleted(reconcilor, "user@gmail.com", | 602 SimulateMergeSessionCompleted(reconcilor, "user@gmail.com", |
603 GoogleServiceAuthError::AuthErrorNone()); | 603 GoogleServiceAuthError::AuthErrorNone()); |
604 ASSERT_FALSE(reconcilor->is_reconcile_started_); | 604 ASSERT_FALSE(reconcilor->is_reconcile_started_); |
605 } | 605 } |
606 | 606 |
607 INSTANTIATE_TEST_CASE_P(AccountReconcilorMaybeEnabled, | 607 INSTANTIATE_TEST_CASE_P(AccountReconcilorMaybeEnabled, |
608 AccountReconcilorTest, | 608 AccountReconcilorTest, |
609 testing::Bool()); | 609 testing::Bool()); |
610 | 610 |
OLD | NEW |