Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Side by Side Diff: chrome/browser/signin/account_reconcilor_unittest.cc

Issue 1070563004: GCMS has automatic checks for CheckExternalConnections. It will be (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: AccountReconcilor tests need a fake list_accounts response, not a fake check_cc_results response. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/signin/core/browser/account_reconcilor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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());
OLDNEW
« no previous file with comments | « no previous file | components/signin/core/browser/account_reconcilor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698