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/bookmark_data_type_controller.h" | 5 #include "chrome/browser/sync/glue/bookmark_data_type_controller.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/callback.h" | 9 #include "base/callback.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 137 |
138 void Start() { | 138 void Start() { |
139 bookmark_dtc_->LoadModels( | 139 bookmark_dtc_->LoadModels( |
140 base::Bind(&ModelLoadCallbackMock::Run, | 140 base::Bind(&ModelLoadCallbackMock::Run, |
141 base::Unretained(&model_load_callback_))); | 141 base::Unretained(&model_load_callback_))); |
142 bookmark_dtc_->StartAssociating( | 142 bookmark_dtc_->StartAssociating( |
143 base::Bind(&StartCallbackMock::Run, | 143 base::Bind(&StartCallbackMock::Run, |
144 base::Unretained(&start_callback_))); | 144 base::Unretained(&start_callback_))); |
145 } | 145 } |
146 | 146 |
147 MessageLoopForUI message_loop_; | 147 base::MessageLoopForUI message_loop_; |
148 content::TestBrowserThread ui_thread_; | 148 content::TestBrowserThread ui_thread_; |
149 scoped_refptr<BookmarkDataTypeController> bookmark_dtc_; | 149 scoped_refptr<BookmarkDataTypeController> bookmark_dtc_; |
150 scoped_ptr<ProfileSyncComponentsFactoryMock> profile_sync_factory_; | 150 scoped_ptr<ProfileSyncComponentsFactoryMock> profile_sync_factory_; |
151 ProfileMock profile_; | 151 ProfileMock profile_; |
152 BookmarkModel* bookmark_model_; | 152 BookmarkModel* bookmark_model_; |
153 HistoryMock* history_service_; | 153 HistoryMock* history_service_; |
154 ProfileSyncServiceMock service_; | 154 ProfileSyncServiceMock service_; |
155 ModelAssociatorMock* model_associator_; | 155 ModelAssociatorMock* model_associator_; |
156 ChangeProcessorMock* change_processor_; | 156 ChangeProcessorMock* change_processor_; |
157 StartCallbackMock start_callback_; | 157 StartCallbackMock start_callback_; |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 WillOnce(InvokeWithoutArgs(bookmark_dtc_.get(), | 322 WillOnce(InvokeWithoutArgs(bookmark_dtc_.get(), |
323 &BookmarkDataTypeController::Stop)); | 323 &BookmarkDataTypeController::Stop)); |
324 SetStopExpectations(); | 324 SetStopExpectations(); |
325 | 325 |
326 EXPECT_CALL(start_callback_, Run(DataTypeController::OK, _, _)); | 326 EXPECT_CALL(start_callback_, Run(DataTypeController::OK, _, _)); |
327 Start(); | 327 Start(); |
328 // This should cause bookmark_dtc_->Stop() to be called. | 328 // This should cause bookmark_dtc_->Stop() to be called. |
329 bookmark_dtc_->OnSingleDatatypeUnrecoverableError(FROM_HERE, "Test"); | 329 bookmark_dtc_->OnSingleDatatypeUnrecoverableError(FROM_HERE, "Test"); |
330 base::RunLoop().RunUntilIdle(); | 330 base::RunLoop().RunUntilIdle(); |
331 } | 331 } |
OLD | NEW |