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

Side by Side Diff: chrome/browser/sync/profile_sync_service_session_unittest.cc

Issue 12502017: signin: pull basic SigninManager functionality into new SigninManagerBase class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix override Created 7 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 | Annotate | Revision Log
OLDNEW
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 <map> 5 #include <map>
6 #include <string> 6 #include <string>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 namespace browser_sync { 68 namespace browser_sync {
69 69
70 namespace { 70 namespace {
71 71
72 class FakeProfileSyncService : public TestProfileSyncService { 72 class FakeProfileSyncService : public TestProfileSyncService {
73 public: 73 public:
74 FakeProfileSyncService( 74 FakeProfileSyncService(
75 ProfileSyncComponentsFactory* factory, 75 ProfileSyncComponentsFactory* factory,
76 Profile* profile, 76 Profile* profile,
77 SigninManager* signin, 77 SigninManagerBase* signin,
78 ProfileSyncService::StartBehavior behavior, 78 ProfileSyncService::StartBehavior behavior,
79 bool synchronous_backend_initialization) 79 bool synchronous_backend_initialization)
80 : TestProfileSyncService(factory, 80 : TestProfileSyncService(factory,
81 profile, 81 profile,
82 signin, 82 signin,
83 behavior, 83 behavior,
84 synchronous_backend_initialization) {} 84 synchronous_backend_initialization) {}
85 virtual ~FakeProfileSyncService() {} 85 virtual ~FakeProfileSyncService() {}
86 86
87 virtual scoped_ptr<DeviceInfo> GetLocalDeviceInfo() const OVERRIDE { 87 virtual scoped_ptr<DeviceInfo> GetLocalDeviceInfo() const OVERRIDE {
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 MessageLoop::current()->RunUntilIdle(); 252 MessageLoop::current()->RunUntilIdle();
253 io_thread_.Stop(); 253 io_thread_.Stop();
254 MessageLoop::current()->RunUntilIdle(); 254 MessageLoop::current()->RunUntilIdle();
255 BrowserWithTestWindowTest::TearDown(); 255 BrowserWithTestWindowTest::TearDown();
256 } 256 }
257 257
258 bool StartSyncService(const base::Closure& callback, 258 bool StartSyncService(const base::Closure& callback,
259 bool will_fail_association) { 259 bool will_fail_association) {
260 if (sync_service_.get()) 260 if (sync_service_.get())
261 return false; 261 return false;
262 SigninManager* signin = SigninManagerFactory::GetForProfile(profile()); 262 SigninManagerBase* signin =
263 SigninManagerFactory::GetForProfile(profile());
263 signin->SetAuthenticatedUsername("test_user"); 264 signin->SetAuthenticatedUsername("test_user");
264 ProfileSyncComponentsFactoryMock* factory = 265 ProfileSyncComponentsFactoryMock* factory =
265 new ProfileSyncComponentsFactoryMock(); 266 new ProfileSyncComponentsFactoryMock();
266 sync_service_.reset(new FakeProfileSyncService( 267 sync_service_.reset(new FakeProfileSyncService(
267 factory, 268 factory,
268 profile(), 269 profile(),
269 signin, 270 signin,
270 ProfileSyncService::AUTO_START, 271 ProfileSyncService::AUTO_START,
271 false)); 272 false));
272 sync_service_->set_backend_init_callback(callback); 273 sync_service_->set_backend_init_callback(callback);
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after
1244 sync_pb::SessionSpecifics specifics; 1245 sync_pb::SessionSpecifics specifics;
1245 header.SetSessionSpecifics(specifics); 1246 header.SetSessionSpecifics(specifics);
1246 } 1247 }
1247 // Ensure we associate properly despite the pre-existing node with our local 1248 // Ensure we associate properly despite the pre-existing node with our local
1248 // tag. 1249 // tag.
1249 error = model_associator_->AssociateModels(NULL, NULL); 1250 error = model_associator_->AssociateModels(NULL, NULL);
1250 ASSERT_FALSE(error.IsSet()); 1251 ASSERT_FALSE(error.IsSet());
1251 } 1252 }
1252 1253
1253 } // namespace browser_sync 1254 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698