| 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/sync_bookmarks/bookmark_data_type_controller.h" | 5 #include "components/sync_bookmarks/bookmark_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" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
| 13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 14 #include "base/run_loop.h" | 14 #include "base/run_loop.h" |
| 15 #include "base/threading/thread_task_runner_handle.h" | 15 #include "base/threading/thread_task_runner_handle.h" |
| 16 #include "components/bookmarks/browser/bookmark_model.h" | 16 #include "components/bookmarks/browser/bookmark_model.h" |
| 17 #include "components/bookmarks/test/bookmark_test_helpers.h" | 17 #include "components/bookmarks/test/bookmark_test_helpers.h" |
| 18 #include "components/bookmarks/test/test_bookmark_client.h" | 18 #include "components/bookmarks/test/test_bookmark_client.h" |
| 19 #include "components/history/core/browser/history_service.h" | 19 #include "components/history/core/browser/history_service.h" |
| 20 #include "components/prefs/testing_pref_service.h" | 20 #include "components/prefs/testing_pref_service.h" |
| 21 #include "components/sync/api/sync_error.h" |
| 21 #include "components/sync_driver/change_processor_mock.h" | 22 #include "components/sync_driver/change_processor_mock.h" |
| 22 #include "components/sync_driver/data_type_controller_mock.h" | 23 #include "components/sync_driver/data_type_controller_mock.h" |
| 23 #include "components/sync_driver/fake_sync_client.h" | 24 #include "components/sync_driver/fake_sync_client.h" |
| 24 #include "components/sync_driver/fake_sync_service.h" | 25 #include "components/sync_driver/fake_sync_service.h" |
| 25 #include "components/sync_driver/model_associator_mock.h" | 26 #include "components/sync_driver/model_associator_mock.h" |
| 26 #include "components/sync_driver/sync_api_component_factory_mock.h" | 27 #include "components/sync_driver/sync_api_component_factory_mock.h" |
| 27 #include "sync/api/sync_error.h" | |
| 28 #include "testing/gmock/include/gmock/gmock.h" | 28 #include "testing/gmock/include/gmock/gmock.h" |
| 29 #include "testing/gtest/include/gtest/gtest.h" | 29 #include "testing/gtest/include/gtest/gtest.h" |
| 30 | 30 |
| 31 using bookmarks::BookmarkModel; | 31 using bookmarks::BookmarkModel; |
| 32 using browser_sync::BookmarkDataTypeController; | 32 using browser_sync::BookmarkDataTypeController; |
| 33 using sync_driver::ChangeProcessorMock; | 33 using sync_driver::ChangeProcessorMock; |
| 34 using sync_driver::DataTypeController; | 34 using sync_driver::DataTypeController; |
| 35 using sync_driver::ModelAssociatorMock; | 35 using sync_driver::ModelAssociatorMock; |
| 36 using sync_driver::ModelLoadCallbackMock; | 36 using sync_driver::ModelLoadCallbackMock; |
| 37 using sync_driver::StartCallbackMock; | 37 using sync_driver::StartCallbackMock; |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 SetStopExpectations(); | 297 SetStopExpectations(); |
| 298 | 298 |
| 299 EXPECT_EQ(DataTypeController::NOT_RUNNING, bookmark_dtc_->state()); | 299 EXPECT_EQ(DataTypeController::NOT_RUNNING, bookmark_dtc_->state()); |
| 300 | 300 |
| 301 EXPECT_CALL(start_callback_, Run(DataTypeController::OK, _, _)); | 301 EXPECT_CALL(start_callback_, Run(DataTypeController::OK, _, _)); |
| 302 Start(); | 302 Start(); |
| 303 EXPECT_EQ(DataTypeController::RUNNING, bookmark_dtc_->state()); | 303 EXPECT_EQ(DataTypeController::RUNNING, bookmark_dtc_->state()); |
| 304 bookmark_dtc_->Stop(); | 304 bookmark_dtc_->Stop(); |
| 305 EXPECT_EQ(DataTypeController::NOT_RUNNING, bookmark_dtc_->state()); | 305 EXPECT_EQ(DataTypeController::NOT_RUNNING, bookmark_dtc_->state()); |
| 306 } | 306 } |
| OLD | NEW |