| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/callback.h" | 5 #include "base/callback.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "components/sync_driver/fake_data_type_controller.h" | 7 #include "components/sync_driver/fake_data_type_controller.h" |
| 8 #include "components/sync_driver/model_association_manager.h" | 8 #include "components/sync_driver/model_association_manager.h" |
| 9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 11 |
| 12 using ::testing::_; | 12 using ::testing::_; |
| 13 namespace browser_sync { | 13 |
| 14 namespace sync_driver { |
| 15 |
| 14 class MockModelAssociationManagerDelegate : | 16 class MockModelAssociationManagerDelegate : |
| 15 public ModelAssociationManagerDelegate { | 17 public ModelAssociationManagerDelegate { |
| 16 public: | 18 public: |
| 17 MockModelAssociationManagerDelegate() {} | 19 MockModelAssociationManagerDelegate() {} |
| 18 ~MockModelAssociationManagerDelegate() {} | 20 ~MockModelAssociationManagerDelegate() {} |
| 19 MOCK_METHOD2(OnSingleDataTypeAssociationDone, | 21 MOCK_METHOD2(OnSingleDataTypeAssociationDone, |
| 20 void(syncer::ModelType type, | 22 void(syncer::ModelType type, |
| 21 const syncer::DataTypeAssociationStats& association_stats)); | 23 const syncer::DataTypeAssociationStats& association_stats)); |
| 22 MOCK_METHOD1(OnSingleDataTypeWillStop, void(syncer::ModelType)); | 24 MOCK_METHOD1(OnSingleDataTypeWillStop, void(syncer::ModelType)); |
| 23 MOCK_METHOD1(OnModelAssociationDone, void( | 25 MOCK_METHOD1(OnModelAssociationDone, void( |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 WillOnce(VerifyResult(expected_result)); | 383 WillOnce(VerifyResult(expected_result)); |
| 382 | 384 |
| 383 model_association_manager.Initialize(types); | 385 model_association_manager.Initialize(types); |
| 384 EXPECT_EQ(DataTypeController::DISABLED, | 386 EXPECT_EQ(DataTypeController::DISABLED, |
| 385 GetController(controllers_, syncer::BOOKMARKS)->state()); | 387 GetController(controllers_, syncer::BOOKMARKS)->state()); |
| 386 model_association_manager.StartAssociationAsync(types); | 388 model_association_manager.StartAssociationAsync(types); |
| 387 EXPECT_EQ(DataTypeController::NOT_RUNNING, | 389 EXPECT_EQ(DataTypeController::NOT_RUNNING, |
| 388 GetController(controllers_, syncer::BOOKMARKS)->state()); | 390 GetController(controllers_, syncer::BOOKMARKS)->state()); |
| 389 } | 391 } |
| 390 | 392 |
| 391 } // namespace browser_sync | 393 } // namespace sync_driver |
| OLD | NEW |