OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_) | 186 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_) |
187 ->UpdateCredentials("test", "oauth2_login_token"); | 187 ->UpdateCredentials("test", "oauth2_login_token"); |
188 } | 188 } |
189 | 189 |
190 void CreateService(ProfileSyncServiceStartBehavior behavior) { | 190 void CreateService(ProfileSyncServiceStartBehavior behavior) { |
191 SigninManagerBase* signin = | 191 SigninManagerBase* signin = |
192 SigninManagerFactory::GetForProfile(profile_); | 192 SigninManagerFactory::GetForProfile(profile_); |
193 signin->SetAuthenticatedUsername("test"); | 193 signin->SetAuthenticatedUsername("test"); |
194 ProfileOAuth2TokenService* oauth2_token_service = | 194 ProfileOAuth2TokenService* oauth2_token_service = |
195 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); | 195 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); |
196 components_factory_ = new StrictMock<ProfileSyncComponentsFactoryMock>(); | 196 components_factory_ = new ProfileSyncComponentsFactoryMock(); |
197 service_.reset(new ProfileSyncService( | 197 service_.reset(new ProfileSyncService( |
198 components_factory_, | 198 scoped_ptr<ProfileSyncComponentsFactory>(components_factory_), |
199 profile_, | 199 profile_, |
200 make_scoped_ptr(new SupervisedUserSigninManagerWrapper(profile_, | 200 make_scoped_ptr(new SupervisedUserSigninManagerWrapper(profile_, |
201 signin)), | 201 signin)), |
202 oauth2_token_service, | 202 oauth2_token_service, |
203 behavior)); | 203 behavior)); |
204 service_->SetClearingBrowseringDataForTesting( | 204 service_->SetClearingBrowseringDataForTesting( |
205 base::Bind(&ProfileSyncServiceTest::ClearBrowsingDataCallback, | 205 base::Bind(&ProfileSyncServiceTest::ClearBrowsingDataCallback, |
206 base::Unretained(this))); | 206 base::Unretained(this))); |
207 } | 207 } |
208 | 208 |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 // See that we can override the URL with a flag. | 615 // See that we can override the URL with a flag. |
616 CommandLine command_line( | 616 CommandLine command_line( |
617 base::FilePath(base::FilePath(FILE_PATH_LITERAL("chrome.exe")))); | 617 base::FilePath(base::FilePath(FILE_PATH_LITERAL("chrome.exe")))); |
618 command_line.AppendSwitchASCII(switches::kSyncServiceURL, "https://foo/bar"); | 618 command_line.AppendSwitchASCII(switches::kSyncServiceURL, "https://foo/bar"); |
619 EXPECT_EQ("https://foo/bar", | 619 EXPECT_EQ("https://foo/bar", |
620 ProfileSyncService::GetSyncServiceURL(command_line).spec()); | 620 ProfileSyncService::GetSyncServiceURL(command_line).spec()); |
621 } | 621 } |
622 | 622 |
623 } // namespace | 623 } // namespace |
624 } // namespace browser_sync | 624 } // namespace browser_sync |
OLD | NEW |