mock_remote_file_sync_service.cc revision 5821806d5e7f356e8fa4b058a389a808ea183019
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
3// found in the LICENSE file.
4
5#include "chrome/browser/sync_file_system/mock_remote_file_sync_service.h"
6
7#include "base/bind.h"
8#include "base/location.h"
9#include "base/message_loop_proxy.h"
10#include "chrome/browser/sync_file_system/local_change_processor.h"
11#include "googleurl/src/gurl.h"
12#include "webkit/fileapi/file_system_url.h"
13
14using ::testing::_;
15using ::testing::Invoke;
16using ::testing::Return;
17
18namespace sync_file_system {
19
20MockRemoteFileSyncService::MockRemoteFileSyncService() {
21  typedef MockRemoteFileSyncService self;
22  ON_CALL(*this, ProcessRemoteChange(_, _))
23      .WillByDefault(Invoke(this, &self::ProcessRemoteChangeStub));
24  ON_CALL(*this, GetLocalChangeProcessor())
25      .WillByDefault(Return(local_change_processor_.get()));
26}
27
28MockRemoteFileSyncService::~MockRemoteFileSyncService() {
29}
30
31void MockRemoteFileSyncService::ProcessRemoteChangeStub(
32    RemoteChangeProcessor* processor,
33    const fileapi::SyncFileCallback& callback) {
34  base::MessageLoopProxy::current()->PostTask(
35      FROM_HERE,
36      base::Bind(callback, fileapi::SYNC_STATUS_NO_CHANGE_TO_SYNC,
37                 fileapi::FileSystemURL()));
38}
39
40}  // namespace sync_file_system
41