Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/location.h" | 7 #include "base/location.h" |
| 8 #include "chrome/browser/sync/internal_api/write_transaction.h" | 8 #include "chrome/browser/sync/internal_api/write_transaction.h" |
| 9 #include "chrome/browser/sync/protocol/sync.pb.h" | 9 #include "chrome/browser/sync/protocol/sync.pb.h" |
| 10 #include "chrome/browser/sync/syncable/directory_manager.h" | 10 #include "chrome/browser/sync/syncable/directory_manager.h" |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 using syncable::UNITTEST; | 32 using syncable::UNITTEST; |
| 33 using syncable::WriteTransaction; | 33 using syncable::WriteTransaction; |
| 34 | 34 |
| 35 /* static */ | 35 /* static */ |
| 36 const std::string ProfileSyncServiceTestHelper::GetTagForType( | 36 const std::string ProfileSyncServiceTestHelper::GetTagForType( |
| 37 ModelType model_type) { | 37 ModelType model_type) { |
| 38 return syncable::ModelTypeToRootTag(model_type); | 38 return syncable::ModelTypeToRootTag(model_type); |
| 39 } | 39 } |
| 40 | 40 |
| 41 /* static */ | 41 /* static */ |
| 42 bool ProfileSyncServiceTestHelper::CreateRoot( | 42 bool ProfileSyncServiceTestHelper::CreateRoot(ModelType model_type, |
|
akalin
2011/10/10 21:58:57
revert these diffs please (as far as I can tell, t
Ilya Sherman
2011/10/10 22:33:13
Done.
| |
| 43 ModelType model_type, UserShare* user_share, | 43 UserShare* user_share, |
| 44 TestIdFactory* ids) { | 44 TestIdFactory* ids) { |
| 45 DirectoryManager* dir_manager = user_share->dir_manager.get(); | 45 DirectoryManager* dir_manager = user_share->dir_manager.get(); |
| 46 | 46 |
| 47 ScopedDirLookup dir(dir_manager, user_share->name); | 47 ScopedDirLookup dir(dir_manager, user_share->name); |
| 48 if (!dir.good()) | 48 if (!dir.good()) |
| 49 return false; | 49 return false; |
| 50 | 50 |
| 51 std::string tag_name = GetTagForType(model_type); | 51 std::string tag_name = GetTagForType(model_type); |
| 52 | 52 |
| 53 WriteTransaction wtrans(FROM_HERE, UNITTEST, dir); | 53 WriteTransaction wtrans(FROM_HERE, UNITTEST, dir); |
| 54 MutableEntry node(&wtrans, | 54 MutableEntry node(&wtrans, |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 ui_loop_.RunAllPending(); | 112 ui_loop_.RunAllPending(); |
| 113 } | 113 } |
| 114 | 114 |
| 115 bool AbstractProfileSyncServiceTest::CreateRoot(ModelType model_type) { | 115 bool AbstractProfileSyncServiceTest::CreateRoot(ModelType model_type) { |
| 116 return ProfileSyncServiceTestHelper::CreateRoot( | 116 return ProfileSyncServiceTestHelper::CreateRoot( |
| 117 model_type, | 117 model_type, |
| 118 service_->GetUserShare(), | 118 service_->GetUserShare(), |
| 119 service_->id_factory()); | 119 service_->id_factory()); |
| 120 } | 120 } |
| 121 | 121 |
| 122 CreateRootTask::CreateRootTask( | 122 CreateRootTask::CreateRootTask(AbstractProfileSyncServiceTest* test, |
| 123 AbstractProfileSyncServiceTest* test, ModelType model_type) | 123 ModelType model_type) |
| 124 : test_(test), model_type_(model_type), success_(false) { | 124 : test_(test), |
| 125 model_type_(model_type), | |
| 126 success_(false) { | |
| 125 } | 127 } |
| 126 | 128 |
| 127 CreateRootTask::~CreateRootTask() {} | 129 CreateRootTask::~CreateRootTask() { |
| 130 } | |
| 131 | |
| 128 void CreateRootTask::Run() { | 132 void CreateRootTask::Run() { |
| 129 success_ = test_->CreateRoot(model_type_); | 133 success_ = test_->CreateRoot(model_type_); |
| 130 } | 134 } |
| 131 | 135 |
| 132 bool CreateRootTask::success() { | 136 bool CreateRootTask::success() { |
| 133 return success_; | 137 return success_; |
| 134 } | 138 } |
| OLD | NEW |