| 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/chromeos/gdata/mock_gdata_documents_service.h" | 5 #include "chrome/browser/chromeos/gdata/mock_gdata_documents_service.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 base::MessageLoopProxy::current()->PostTask( | 175 base::MessageLoopProxy::current()->PostTask( |
| 176 FROM_HERE, | 176 FROM_HERE, |
| 177 base::Bind(callback, HTTP_SUCCESS, base::Passed(&directory_data_))); | 177 base::Bind(callback, HTTP_SUCCESS, base::Passed(&directory_data_))); |
| 178 } | 178 } |
| 179 | 179 |
| 180 void MockDocumentsService::DownloadFileStub( | 180 void MockDocumentsService::DownloadFileStub( |
| 181 const FilePath& virtual_path, | 181 const FilePath& virtual_path, |
| 182 const FilePath& local_tmp_path, | 182 const FilePath& local_tmp_path, |
| 183 const GURL& content_url, | 183 const GURL& content_url, |
| 184 const DownloadActionCallback& download_action_callback, | 184 const DownloadActionCallback& download_action_callback, |
| 185 const GetDownloadDataCallback& get_download_data_callback) { | 185 const GetContentCallback& get_content_callback) { |
| 186 GDataErrorCode error = HTTP_SUCCESS; | 186 GDataErrorCode error = HTTP_SUCCESS; |
| 187 if (file_data_.get()) { | 187 if (file_data_.get()) { |
| 188 int file_data_size = static_cast<int>(file_data_->size()); | 188 int file_data_size = static_cast<int>(file_data_->size()); |
| 189 ASSERT_EQ(file_data_size, | 189 ASSERT_EQ(file_data_size, |
| 190 file_util::WriteFile(local_tmp_path, file_data_->data(), | 190 file_util::WriteFile(local_tmp_path, file_data_->data(), |
| 191 file_data_size)); | 191 file_data_size)); |
| 192 } | 192 } |
| 193 base::MessageLoopProxy::current()->PostTask( | 193 base::MessageLoopProxy::current()->PostTask( |
| 194 FROM_HERE, | 194 FROM_HERE, |
| 195 base::Bind(download_action_callback, error, content_url, local_tmp_path)); | 195 base::Bind(download_action_callback, error, content_url, local_tmp_path)); |
| 196 } | 196 } |
| 197 | 197 |
| 198 } // namespace gdata | 198 } // namespace gdata |
| OLD | NEW |