| 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" |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 EXPECT_EQ(GetController(controllers_, syncer::BOOKMARKS)->state(), | 332 EXPECT_EQ(GetController(controllers_, syncer::BOOKMARKS)->state(), |
| 333 DataTypeController::ASSOCIATING); | 333 DataTypeController::ASSOCIATING); |
| 334 GetController(controllers_, syncer::BOOKMARKS)->FinishStart( | 334 GetController(controllers_, syncer::BOOKMARKS)->FinishStart( |
| 335 DataTypeController::OK); | 335 DataTypeController::OK); |
| 336 EXPECT_EQ(GetController(controllers_, syncer::BOOKMARKS)->state(), | 336 EXPECT_EQ(GetController(controllers_, syncer::BOOKMARKS)->state(), |
| 337 DataTypeController::RUNNING); | 337 DataTypeController::RUNNING); |
| 338 | 338 |
| 339 testing::Mock::VerifyAndClearExpectations(&delegate_); | 339 testing::Mock::VerifyAndClearExpectations(&delegate_); |
| 340 EXPECT_CALL(delegate_, | 340 EXPECT_CALL(delegate_, |
| 341 OnSingleDataTypeWillStop(syncer::BOOKMARKS, _)); | 341 OnSingleDataTypeWillStop(syncer::BOOKMARKS, _)); |
| 342 syncer::SyncError error(FROM_HERE, |
| 343 syncer::SyncError::DATATYPE_ERROR, |
| 344 "error", |
| 345 syncer::BOOKMARKS); |
| 342 GetController(controllers_, syncer::BOOKMARKS) | 346 GetController(controllers_, syncer::BOOKMARKS) |
| 343 ->OnSingleDatatypeUnrecoverableError(FROM_HERE, "runtime error"); | 347 ->OnSingleDataTypeUnrecoverableError(error); |
| 344 } | 348 } |
| 345 | 349 |
| 346 } // namespace sync_driver | 350 } // namespace sync_driver |
| OLD | NEW |