| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/sync_backend_host_mock.h" | 5 #include "chrome/browser/sync/glue/sync_backend_host_mock.h" |
| 6 | 6 |
| 7 namespace browser_sync { | 7 namespace browser_sync { |
| 8 | 8 |
| 9 ACTION(InvokeTask) { | 9 ACTION(InvokeTask) { |
| 10 arg2->Run(); | 10 arg2->Run(); |
| 11 delete arg2; | 11 delete arg2; |
| 12 } | 12 } |
| 13 | 13 |
| 14 SyncBackendHostMock::SyncBackendHostMock() { | 14 SyncBackendHostMock::SyncBackendHostMock() { |
| 15 // By default, the RequestPause and RequestResume methods will | |
| 16 // send the confirmation notification and return true. | |
| 17 ON_CALL(*this, RequestPause()). | |
| 18 WillByDefault(testing::DoAll(Notify(NotificationType::SYNC_PAUSED), | |
| 19 testing::Return(true))); | |
| 20 ON_CALL(*this, RequestResume()). | |
| 21 WillByDefault(testing::DoAll(Notify(NotificationType::SYNC_RESUMED), | |
| 22 testing::Return(true))); | |
| 23 | |
| 24 // By default, invoke the ready callback. | 15 // By default, invoke the ready callback. |
| 25 ON_CALL(*this, ConfigureDataTypes(testing::_, testing::_, testing::_)). | 16 ON_CALL(*this, ConfigureDataTypes(testing::_, testing::_, testing::_)). |
| 26 WillByDefault(InvokeTask()); | 17 WillByDefault(InvokeTask()); |
| 27 } | 18 } |
| 28 | 19 |
| 29 SyncBackendHostMock::~SyncBackendHostMock() {} | 20 SyncBackendHostMock::~SyncBackendHostMock() {} |
| 30 | 21 |
| 31 } // namespace browser_sync | 22 } // namespace browser_sync |
| OLD | NEW |