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/glue/data_type_manager_impl.h" | 5 #include "chrome/browser/sync/glue/data_type_manager_impl.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "chrome/browser/sync/glue/backend_data_type_configurer.h" | 9 #include "chrome/browser/sync/glue/backend_data_type_configurer.h" |
10 #include "chrome/browser/sync/glue/data_type_controller.h" | 10 #include "chrome/browser/sync/glue/data_type_controller.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 ModelType model_type) const { | 137 ModelType model_type) const { |
138 DataTypeController::TypeMap::const_iterator it = | 138 DataTypeController::TypeMap::const_iterator it = |
139 controllers_.find(model_type); | 139 controllers_.find(model_type); |
140 if (it == controllers_.end()) { | 140 if (it == controllers_.end()) { |
141 return NULL; | 141 return NULL; |
142 } | 142 } |
143 return make_scoped_refptr( | 143 return make_scoped_refptr( |
144 static_cast<FakeDataTypeController*>(it->second.get())); | 144 static_cast<FakeDataTypeController*>(it->second.get())); |
145 } | 145 } |
146 | 146 |
147 MessageLoopForUI ui_loop_; | 147 base::MessageLoopForUI ui_loop_; |
148 content::TestBrowserThread ui_thread_; | 148 content::TestBrowserThread ui_thread_; |
149 DataTypeController::TypeMap controllers_; | 149 DataTypeController::TypeMap controllers_; |
150 FakeBackendDataTypeConfigurer configurer_; | 150 FakeBackendDataTypeConfigurer configurer_; |
151 DataTypeManagerObserverMock observer_; | 151 DataTypeManagerObserverMock observer_; |
152 scoped_ptr<DataTypeManagerImpl> dtm_; | 152 scoped_ptr<DataTypeManagerImpl> dtm_; |
153 }; | 153 }; |
154 | 154 |
155 // Set up a DTM with no controllers, configure it, finish downloading, | 155 // Set up a DTM with no controllers, configure it, finish downloading, |
156 // and then stop it. | 156 // and then stop it. |
157 TEST_F(SyncDataTypeManagerImplTest, NoControllers) { | 157 TEST_F(SyncDataTypeManagerImplTest, NoControllers) { |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 EXPECT_EQ(DataTypeManager::CONFIGURING, dtm_->state()); | 784 EXPECT_EQ(DataTypeManager::CONFIGURING, dtm_->state()); |
785 | 785 |
786 // Start the preferences controller. We don't need to start controller for | 786 // Start the preferences controller. We don't need to start controller for |
787 // the NIGORI because it has none. We don't need to start the controller for | 787 // the NIGORI because it has none. We don't need to start the controller for |
788 // the BOOKMARKS because it was never stopped. | 788 // the BOOKMARKS because it was never stopped. |
789 GetController(PREFERENCES)->FinishStart(DataTypeController::OK); | 789 GetController(PREFERENCES)->FinishStart(DataTypeController::OK); |
790 EXPECT_EQ(DataTypeManager::CONFIGURED, dtm_->state()); | 790 EXPECT_EQ(DataTypeManager::CONFIGURED, dtm_->state()); |
791 } | 791 } |
792 | 792 |
793 } // namespace browser_sync | 793 } // namespace browser_sync |
OLD | NEW |