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 <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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 true /* setup_for_test */); | 294 true /* setup_for_test */); |
295 change_processor_ = new SessionChangeProcessor( | 295 change_processor_ = new SessionChangeProcessor( |
296 dtc, model_associator_, | 296 dtc, model_associator_, |
297 true /* setup_for_test */); | 297 true /* setup_for_test */); |
298 EXPECT_CALL(*factory, CreateSessionSyncComponents(_, _)). | 298 EXPECT_CALL(*factory, CreateSessionSyncComponents(_, _)). |
299 WillOnce(Return(ProfileSyncComponentsFactory::SyncComponents( | 299 WillOnce(Return(ProfileSyncComponentsFactory::SyncComponents( |
300 model_associator_, change_processor_))); | 300 model_associator_, change_processor_))); |
301 EXPECT_CALL(*factory, CreateDataTypeManager(_, _, _, _, _, _)). | 301 EXPECT_CALL(*factory, CreateDataTypeManager(_, _, _, _, _, _)). |
302 WillOnce(ReturnNewDataTypeManager()); | 302 WillOnce(ReturnNewDataTypeManager()); |
303 | 303 |
304 TokenServiceFactory::GetForProfile(profile())->IssueAuthTokenForTest( | 304 ProfileOAuth2TokenServiceFactory::GetForProfile(profile()) |
305 GaiaConstants::kGaiaOAuth2LoginRefreshToken, "oauth2_login_token"); | 305 ->UpdateCredentials("test_user", "oauth2_login_token"); |
306 TokenServiceFactory::GetForProfile(profile())->IssueAuthTokenForTest( | 306 TokenServiceFactory::GetForProfile(profile()) |
307 GaiaConstants::kSyncService, "token"); | 307 ->IssueAuthTokenForTest(GaiaConstants::kSyncService, "token"); |
308 sync_service_->Initialize(); | 308 sync_service_->Initialize(); |
309 base::MessageLoop::current()->Run(); | 309 base::MessageLoop::current()->Run(); |
310 return true; | 310 return true; |
311 } | 311 } |
312 | 312 |
313 // Path used in testing. | 313 // Path used in testing. |
314 base::ScopedTempDir temp_dir_; | 314 base::ScopedTempDir temp_dir_; |
315 SessionModelAssociator* model_associator_; | 315 SessionModelAssociator* model_associator_; |
316 SessionChangeProcessor* change_processor_; | 316 SessionChangeProcessor* change_processor_; |
317 SessionID window_id_; | 317 SessionID window_id_; |
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1395 tab_node.SetSessionSpecifics(specifics); | 1395 tab_node.SetSessionSpecifics(specifics); |
1396 } | 1396 } |
1397 | 1397 |
1398 error = model_associator_->DisassociateModels(); | 1398 error = model_associator_->DisassociateModels(); |
1399 ASSERT_FALSE(error.IsSet()); | 1399 ASSERT_FALSE(error.IsSet()); |
1400 error = model_associator_->AssociateModels(NULL, NULL); | 1400 error = model_associator_->AssociateModels(NULL, NULL); |
1401 ASSERT_FALSE(error.IsSet()); | 1401 ASSERT_FALSE(error.IsSet()); |
1402 } | 1402 } |
1403 | 1403 |
1404 } // namespace browser_sync | 1404 } // namespace browser_sync |
OLD | NEW |