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

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

Issue 162443004: sync: final pieces to sync deferred initialization (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 6 years, 10 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 80
81 namespace { 81 namespace {
82 82
83 class FakeProfileSyncService : public TestProfileSyncService { 83 class FakeProfileSyncService : public TestProfileSyncService {
84 public: 84 public:
85 FakeProfileSyncService( 85 FakeProfileSyncService(
86 ProfileSyncComponentsFactory* factory, 86 ProfileSyncComponentsFactory* factory,
87 Profile* profile, 87 Profile* profile,
88 SigninManagerBase* signin, 88 SigninManagerBase* signin,
89 ProfileOAuth2TokenService* oauth2_token_service, 89 ProfileOAuth2TokenService* oauth2_token_service,
90 ProfileSyncService::StartBehavior behavior) 90 ProfileSyncServiceStartBehavior behavior)
91 : TestProfileSyncService(factory, 91 : TestProfileSyncService(factory,
92 profile, 92 profile,
93 signin, 93 signin,
94 oauth2_token_service, 94 oauth2_token_service,
95 behavior) {} 95 behavior) {}
96 virtual ~FakeProfileSyncService() {} 96 virtual ~FakeProfileSyncService() {}
97 97
98 virtual scoped_ptr<DeviceInfo> GetLocalDeviceInfo() const OVERRIDE { 98 virtual scoped_ptr<DeviceInfo> GetLocalDeviceInfo() const OVERRIDE {
99 return scoped_ptr<DeviceInfo>(new DeviceInfo(base::GenerateGUID(), 99 return scoped_ptr<DeviceInfo>(new DeviceInfo(base::GenerateGUID(),
100 "client_name", 100 "client_name",
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 signin->SetAuthenticatedUsername("test_user"); 198 signin->SetAuthenticatedUsername("test_user");
199 ProfileOAuth2TokenService* oauth2_token_service = 199 ProfileOAuth2TokenService* oauth2_token_service =
200 ProfileOAuth2TokenServiceFactory::GetForProfile(profile()); 200 ProfileOAuth2TokenServiceFactory::GetForProfile(profile());
201 ProfileSyncComponentsFactoryMock* factory = 201 ProfileSyncComponentsFactoryMock* factory =
202 new ProfileSyncComponentsFactoryMock(); 202 new ProfileSyncComponentsFactoryMock();
203 sync_service_.reset(new FakeProfileSyncService( 203 sync_service_.reset(new FakeProfileSyncService(
204 factory, 204 factory,
205 profile(), 205 profile(),
206 signin, 206 signin,
207 oauth2_token_service, 207 oauth2_token_service,
208 ProfileSyncService::AUTO_START)); 208 browser_sync::AUTO_START));
209 EXPECT_CALL(*factory, CreateSyncBackendHost(_,_,_)). 209 EXPECT_CALL(*factory, CreateSyncBackendHost(_,_,_)).
210 WillOnce(ReturnSyncBackendHost(callback)); 210 WillOnce(ReturnSyncBackendHost(callback));
211 211
212 // Register the session data type. 212 // Register the session data type.
213 SessionDataTypeController *dtc = new SessionDataTypeController(factory, 213 SessionDataTypeController *dtc = new SessionDataTypeController(factory,
214 profile(), 214 profile(),
215 sync_service_.get()); 215 sync_service_.get());
216 sync_service_->RegisterDataTypeController(dtc); 216 sync_service_->RegisterDataTypeController(dtc);
217 217
218 model_associator_ = 218 model_associator_ =
(...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after
1286 tab_node.SetSessionSpecifics(specifics); 1286 tab_node.SetSessionSpecifics(specifics);
1287 } 1287 }
1288 1288
1289 error = model_associator_->DisassociateModels(); 1289 error = model_associator_->DisassociateModels();
1290 ASSERT_FALSE(error.IsSet()); 1290 ASSERT_FALSE(error.IsSet());
1291 error = model_associator_->AssociateModels(NULL, NULL); 1291 error = model_associator_->AssociateModels(NULL, NULL);
1292 ASSERT_FALSE(error.IsSet()); 1292 ASSERT_FALSE(error.IsSet());
1293 } 1293 }
1294 1294
1295 } // namespace browser_sync 1295 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698