| 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 "chrome/browser/sync_file_system/mock_local_change_processor.h" | 5 #include "chrome/browser/sync_file_system/mock_local_change_processor.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
| 10 #include "webkit/fileapi/file_system_url.h" | 10 #include "webkit/fileapi/file_system_url.h" |
| 11 #include "webkit/fileapi/syncable/file_change.h" | 11 #include "webkit/fileapi/syncable/file_change.h" |
| 12 | 12 |
| 13 using ::testing::_; | 13 using ::testing::_; |
| 14 using ::testing::Invoke; | 14 using ::testing::Invoke; |
| 15 using ::testing::Return; | 15 using ::testing::Return; |
| 16 | 16 |
| 17 namespace sync_file_system { | 17 namespace sync_file_system { |
| 18 | 18 |
| 19 MockLocalChangeProcessor::MockLocalChangeProcessor() { | 19 MockLocalChangeProcessor::MockLocalChangeProcessor() { |
| 20 ON_CALL(*this, ApplyLocalChange(_, _, _, _)) | 20 ON_CALL(*this, ApplyLocalChange(_, _, _, _)) |
| 21 .WillByDefault(Invoke(this, | 21 .WillByDefault(Invoke(this, |
| 22 &MockLocalChangeProcessor::ApplyLocalChangeStub)); | 22 &MockLocalChangeProcessor::ApplyLocalChangeStub)); |
| 23 } | 23 } |
| 24 | 24 |
| 25 MockLocalChangeProcessor::~MockLocalChangeProcessor() { | 25 MockLocalChangeProcessor::~MockLocalChangeProcessor() { |
| 26 } | 26 } |
| 27 | 27 |
| 28 void MockLocalChangeProcessor::ApplyLocalChangeStub( | 28 void MockLocalChangeProcessor::ApplyLocalChangeStub( |
| 29 const fileapi::FileChange& change, | 29 const FileChange& change, |
| 30 const base::FilePath& local_file_path, | 30 const base::FilePath& local_file_path, |
| 31 const fileapi::FileSystemURL& url, | 31 const fileapi::FileSystemURL& url, |
| 32 const fileapi::SyncStatusCallback& callback) { | 32 const fileapi::SyncStatusCallback& callback) { |
| 33 base::MessageLoopProxy::current()->PostTask( | 33 base::MessageLoopProxy::current()->PostTask( |
| 34 FROM_HERE, base::Bind(callback, fileapi::SYNC_STATUS_OK)); | 34 FROM_HERE, base::Bind(callback, fileapi::SYNC_STATUS_OK)); |
| 35 } | 35 } |
| 36 | 36 |
| 37 } // namespace sync_file_system | 37 } // namespace sync_file_system |
| OLD | NEW |