| 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_drive_service.h" | 5 #include "chrome/browser/chromeos/gdata/mock_drive_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" |
| 11 #include "base/json/json_file_value_serializer.h" | 11 #include "base/json/json_file_value_serializer.h" |
| 12 #include "base/message_loop_proxy.h" | 12 #include "base/message_loop_proxy.h" |
| 13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
| 14 #include "base/platform_file.h" | 14 #include "base/platform_file.h" |
| 15 #include "chrome/browser/chromeos/gdata/drive_test_util.h" | 15 #include "chrome/browser/chromeos/gdata/drive_test_util.h" |
| 16 #include "chrome/common/chrome_paths.h" | 16 #include "chrome/common/chrome_paths.h" |
| 17 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
| 18 | 18 |
| 19 using ::testing::_; | 19 using ::testing::_; |
| 20 using ::testing::Invoke; | 20 using ::testing::Invoke; |
| 21 using ::testing::Return; |
| 21 | 22 |
| 22 namespace gdata { | 23 namespace gdata { |
| 23 | 24 |
| 24 MockDriveService::MockDriveService() { | 25 MockDriveService::MockDriveService() { |
| 26 ON_CALL(*this, GetProgressStatusList()) |
| 27 .WillByDefault(Return(OperationProgressStatusList())); |
| 25 ON_CALL(*this, Authenticate(_)) | 28 ON_CALL(*this, Authenticate(_)) |
| 26 .WillByDefault(Invoke(this, &MockDriveService::AuthenticateStub)); | 29 .WillByDefault(Invoke(this, &MockDriveService::AuthenticateStub)); |
| 27 ON_CALL(*this, GetDocuments(_, _, _, _, _)) | 30 ON_CALL(*this, GetDocuments(_, _, _, _, _)) |
| 28 .WillByDefault(Invoke(this, &MockDriveService::GetDocumentsStub)); | 31 .WillByDefault(Invoke(this, &MockDriveService::GetDocumentsStub)); |
| 29 ON_CALL(*this, GetAccountMetadata(_)) | 32 ON_CALL(*this, GetAccountMetadata(_)) |
| 30 .WillByDefault(Invoke(this, | 33 .WillByDefault(Invoke(this, |
| 31 &MockDriveService::GetAccountMetadataStub)); | 34 &MockDriveService::GetAccountMetadataStub)); |
| 32 ON_CALL(*this, DeleteDocument(_, _)) | 35 ON_CALL(*this, DeleteDocument(_, _)) |
| 33 .WillByDefault(Invoke(this, &MockDriveService::DeleteDocumentStub)); | 36 .WillByDefault(Invoke(this, &MockDriveService::DeleteDocumentStub)); |
| 34 ON_CALL(*this, DownloadDocument(_, _, _, _, _)) | 37 ON_CALL(*this, DownloadDocument(_, _, _, _, _)) |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 ASSERT_EQ(file_data_size, | 174 ASSERT_EQ(file_data_size, |
| 172 file_util::WriteFile(local_tmp_path, file_data_->data(), | 175 file_util::WriteFile(local_tmp_path, file_data_->data(), |
| 173 file_data_size)); | 176 file_data_size)); |
| 174 } | 177 } |
| 175 base::MessageLoopProxy::current()->PostTask( | 178 base::MessageLoopProxy::current()->PostTask( |
| 176 FROM_HERE, | 179 FROM_HERE, |
| 177 base::Bind(download_action_callback, error, content_url, local_tmp_path)); | 180 base::Bind(download_action_callback, error, content_url, local_tmp_path)); |
| 178 } | 181 } |
| 179 | 182 |
| 180 } // namespace gdata | 183 } // namespace gdata |
| OLD | NEW |