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 "components/search_engines/search_engine_data_type_controller.h" | 5 #include "components/search_engines/search_engine_data_type_controller.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 EXPECT_CALL(model_load_callback_, Run(_, _)); | 77 EXPECT_CALL(model_load_callback_, Run(_, _)); |
78 } | 78 } |
79 | 79 |
80 void Start() { | 80 void Start() { |
81 search_engine_dtc_->LoadModels( | 81 search_engine_dtc_->LoadModels( |
82 base::Bind(&sync_driver::ModelLoadCallbackMock::Run, | 82 base::Bind(&sync_driver::ModelLoadCallbackMock::Run, |
83 base::Unretained(&model_load_callback_))); | 83 base::Unretained(&model_load_callback_))); |
84 search_engine_dtc_->StartAssociating( | 84 search_engine_dtc_->StartAssociating( |
85 base::Bind(&sync_driver::StartCallbackMock::Run, | 85 base::Bind(&sync_driver::StartCallbackMock::Run, |
86 base::Unretained(&start_callback_))); | 86 base::Unretained(&start_callback_))); |
87 base::MessageLoop::current()->RunUntilIdle(); | 87 base::RunLoop().RunUntilIdle(); |
88 } | 88 } |
89 | 89 |
90 base::MessageLoop message_loop_; | 90 base::MessageLoop message_loop_; |
91 std::unique_ptr<TemplateURLService> template_url_service_; | 91 std::unique_ptr<TemplateURLService> template_url_service_; |
92 scoped_refptr<SearchEngineDataTypeController> search_engine_dtc_; | 92 scoped_refptr<SearchEngineDataTypeController> search_engine_dtc_; |
93 SyncApiComponentFactoryMock profile_sync_factory_; | 93 SyncApiComponentFactoryMock profile_sync_factory_; |
94 syncer::FakeSyncableService syncable_service_; | 94 syncer::FakeSyncableService syncable_service_; |
95 sync_driver::StartCallbackMock start_callback_; | 95 sync_driver::StartCallbackMock start_callback_; |
96 sync_driver::ModelLoadCallbackMock model_load_callback_; | 96 sync_driver::ModelLoadCallbackMock model_load_callback_; |
97 }; | 97 }; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 EXPECT_FALSE(syncable_service_.syncing()); | 182 EXPECT_FALSE(syncable_service_.syncing()); |
183 search_engine_dtc_->Stop(); | 183 search_engine_dtc_->Stop(); |
184 EXPECT_EQ(NULL, search_engine_dtc_->GetSubscriptionForTesting()); | 184 EXPECT_EQ(NULL, search_engine_dtc_->GetSubscriptionForTesting()); |
185 EXPECT_EQ(sync_driver::DataTypeController::NOT_RUNNING, | 185 EXPECT_EQ(sync_driver::DataTypeController::NOT_RUNNING, |
186 search_engine_dtc_->state()); | 186 search_engine_dtc_->state()); |
187 EXPECT_FALSE(syncable_service_.syncing()); | 187 EXPECT_FALSE(syncable_service_.syncing()); |
188 } | 188 } |
189 | 189 |
190 } // namespace | 190 } // namespace |
191 } // namespace browser_sync | 191 } // namespace browser_sync |
OLD | NEW |