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/drive/mock_drive_service.h" | 5 #include "chrome/browser/drive/mock_drive_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 ON_CALL(*this, RemoveResourceFromDirectory(_, _, _)) | 47 ON_CALL(*this, RemoveResourceFromDirectory(_, _, _)) |
48 .WillByDefault( | 48 .WillByDefault( |
49 Invoke(this, &MockDriveService::RemoveResourceFromDirectoryStub)); | 49 Invoke(this, &MockDriveService::RemoveResourceFromDirectoryStub)); |
50 ON_CALL(*this, AddNewDirectory(_, _, _)) | 50 ON_CALL(*this, AddNewDirectory(_, _, _)) |
51 .WillByDefault(Invoke(this, &MockDriveService::CreateDirectoryStub)); | 51 .WillByDefault(Invoke(this, &MockDriveService::CreateDirectoryStub)); |
52 ON_CALL(*this, DownloadFile(_, _, _, _, _)) | 52 ON_CALL(*this, DownloadFile(_, _, _, _, _)) |
53 .WillByDefault(Invoke(this, &MockDriveService::DownloadFileStub)); | 53 .WillByDefault(Invoke(this, &MockDriveService::DownloadFileStub)); |
54 | 54 |
55 // Fill in the default values for mock data. | 55 // Fill in the default values for mock data. |
56 directory_data_ = | 56 directory_data_ = |
57 test_util::LoadJSONFile("chromeos/gdata/new_folder_entry.json"); | 57 test_util::LoadJSONFile("gdata/new_folder_entry.json"); |
58 } | 58 } |
59 | 59 |
60 MockDriveService::~MockDriveService() {} | 60 MockDriveService::~MockDriveService() {} |
61 | 61 |
62 CancelCallback MockDriveService::GetChangeListStub( | 62 CancelCallback MockDriveService::GetChangeListStub( |
63 int64 start_changestamp, | 63 int64 start_changestamp, |
64 const GetResourceListCallback& callback) { | 64 const GetResourceListCallback& callback) { |
65 scoped_ptr<ResourceList> resource_list(new ResourceList()); | 65 scoped_ptr<ResourceList> resource_list(new ResourceList()); |
66 base::MessageLoopProxy::current()->PostTask( | 66 base::MessageLoopProxy::current()->PostTask( |
67 FROM_HERE, | 67 FROM_HERE, |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 if (!test_util::WriteStringToFile(local_tmp_path, *file_data_)) | 147 if (!test_util::WriteStringToFile(local_tmp_path, *file_data_)) |
148 error = GDATA_FILE_ERROR; | 148 error = GDATA_FILE_ERROR; |
149 } | 149 } |
150 base::MessageLoopProxy::current()->PostTask( | 150 base::MessageLoopProxy::current()->PostTask( |
151 FROM_HERE, | 151 FROM_HERE, |
152 base::Bind(download_action_callback, error, local_tmp_path)); | 152 base::Bind(download_action_callback, error, local_tmp_path)); |
153 return CancelCallback(); | 153 return CancelCallback(); |
154 } | 154 } |
155 | 155 |
156 } // namespace drive | 156 } // namespace drive |
OLD | NEW |