| 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 "chrome/browser/sync/abstract_profile_sync_service_test.h" | 5 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "chrome/browser/sync/test_profile_sync_service.h" | 10 #include "chrome/browser/sync/test_profile_sync_service.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 ui_loop_.RunUntilIdle(); | 67 ui_loop_.RunUntilIdle(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 bool AbstractProfileSyncServiceTest::CreateRoot(ModelType model_type) { | 70 bool AbstractProfileSyncServiceTest::CreateRoot(ModelType model_type) { |
| 71 return syncer::TestUserShare::CreateRoot(model_type, | 71 return syncer::TestUserShare::CreateRoot(model_type, |
| 72 sync_service_->GetUserShare()); | 72 sync_service_->GetUserShare()); |
| 73 } | 73 } |
| 74 | 74 |
| 75 // static | 75 // static |
| 76 ProfileKeyedService* AbstractProfileSyncServiceTest::BuildTokenService( | 76 ProfileKeyedService* AbstractProfileSyncServiceTest::BuildTokenService( |
| 77 Profile* profile) { | 77 content::BrowserContext* profile) { |
| 78 return new TokenService; | 78 return new TokenService; |
| 79 } | 79 } |
| 80 | 80 |
| 81 CreateRootHelper::CreateRootHelper(AbstractProfileSyncServiceTest* test, | 81 CreateRootHelper::CreateRootHelper(AbstractProfileSyncServiceTest* test, |
| 82 ModelType model_type) | 82 ModelType model_type) |
| 83 : ALLOW_THIS_IN_INITIALIZER_LIST(callback_( | 83 : ALLOW_THIS_IN_INITIALIZER_LIST(callback_( |
| 84 base::Bind(&CreateRootHelper::CreateRootCallback, | 84 base::Bind(&CreateRootHelper::CreateRootCallback, |
| 85 base::Unretained(this)))), | 85 base::Unretained(this)))), |
| 86 test_(test), | 86 test_(test), |
| 87 model_type_(model_type), | 87 model_type_(model_type), |
| 88 success_(false) { | 88 success_(false) { |
| 89 } | 89 } |
| 90 | 90 |
| 91 CreateRootHelper::~CreateRootHelper() { | 91 CreateRootHelper::~CreateRootHelper() { |
| 92 } | 92 } |
| 93 | 93 |
| 94 const base::Closure& CreateRootHelper::callback() const { | 94 const base::Closure& CreateRootHelper::callback() const { |
| 95 return callback_; | 95 return callback_; |
| 96 } | 96 } |
| 97 | 97 |
| 98 bool CreateRootHelper::success() { | 98 bool CreateRootHelper::success() { |
| 99 return success_; | 99 return success_; |
| 100 } | 100 } |
| 101 | 101 |
| 102 void CreateRootHelper::CreateRootCallback() { | 102 void CreateRootHelper::CreateRootCallback() { |
| 103 success_ = test_->CreateRoot(model_type_); | 103 success_ = test_->CreateRoot(model_type_); |
| 104 } | 104 } |
| OLD | NEW |