| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 142 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 143 switches::kEnableNewProfileManagement); | 143 switches::kEnableNewProfileManagement); |
| 144 } | 144 } |
| 145 | 145 |
| 146 list_accounts_url_ = GaiaUrls::GetInstance()->ListAccountsURLWithSource( | 146 list_accounts_url_ = GaiaUrls::GetInstance()->ListAccountsURLWithSource( |
| 147 GaiaConstants::kReconcilorSource); | 147 GaiaConstants::kReconcilorSource); |
| 148 get_check_connection_info_url_ = | 148 get_check_connection_info_url_ = |
| 149 GaiaUrls::GetInstance()->GetCheckConnectionInfoURLWithSource( | 149 GaiaUrls::GetInstance()->GetCheckConnectionInfoURLWithSource( |
| 150 GaiaConstants::kChromeSource); | 150 GaiaConstants::kChromeSource); |
| 151 | 151 |
| 152 SetFakeResponse(get_check_connection_info_url().spec(), "[]", | 152 // Specific tests may set a response that includes specific accounts. |
| 153 net::HTTP_OK, net::URLRequestStatus::SUCCESS); | 153 SetFakeResponse(list_accounts_url().spec(), "", |
| 154 net::HTTP_NOT_FOUND, net::URLRequestStatus::SUCCESS); |
| 154 | 155 |
| 155 testing_profile_manager_.reset( | 156 testing_profile_manager_.reset( |
| 156 new TestingProfileManager(TestingBrowserProcess::GetGlobal())); | 157 new TestingProfileManager(TestingBrowserProcess::GetGlobal())); |
| 157 ASSERT_TRUE(testing_profile_manager_.get()->SetUp()); | 158 ASSERT_TRUE(testing_profile_manager_.get()->SetUp()); |
| 158 | 159 |
| 159 TestingProfile::TestingFactories factories; | 160 TestingProfile::TestingFactories factories; |
| 160 factories.push_back(std::make_pair(ChromeSigninClientFactory::GetInstance(), | 161 factories.push_back(std::make_pair(ChromeSigninClientFactory::GetInstance(), |
| 161 signin::BuildTestSigninClient)); | 162 signin::BuildTestSigninClient)); |
| 162 factories.push_back(std::make_pair( | 163 factories.push_back(std::make_pair( |
| 163 ProfileOAuth2TokenServiceFactory::GetInstance(), | 164 ProfileOAuth2TokenServiceFactory::GetInstance(), |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 ASSERT_TRUE(reconcilor->is_reconcile_started_); | 713 ASSERT_TRUE(reconcilor->is_reconcile_started_); |
| 713 | 714 |
| 714 SimulateAddAccountToCookieCompleted(reconcilor, "user@gmail.com", | 715 SimulateAddAccountToCookieCompleted(reconcilor, "user@gmail.com", |
| 715 GoogleServiceAuthError::AuthErrorNone()); | 716 GoogleServiceAuthError::AuthErrorNone()); |
| 716 ASSERT_FALSE(reconcilor->is_reconcile_started_); | 717 ASSERT_FALSE(reconcilor->is_reconcile_started_); |
| 717 } | 718 } |
| 718 | 719 |
| 719 INSTANTIATE_TEST_CASE_P(AccountReconcilorMaybeEnabled, | 720 INSTANTIATE_TEST_CASE_P(AccountReconcilorMaybeEnabled, |
| 720 AccountReconcilorTest, | 721 AccountReconcilorTest, |
| 721 testing::Bool()); | 722 testing::Bool()); |
| OLD | NEW |