| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/drive/download_handler.h" | 5 #include "chrome/browser/chromeos/drive/download_handler.h" |
| 6 | 6 |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "chrome/browser/chromeos/drive/file_system_util.h" | 9 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| 10 #include "chrome/browser/chromeos/drive/file_write_helper.h" | 10 #include "chrome/browser/chromeos/drive/file_write_helper.h" |
| 11 #include "chrome/browser/chromeos/drive/mock_drive_file_system.h" | 11 #include "chrome/browser/chromeos/drive/mock_file_system.h" |
| 12 #include "chrome/browser/google_apis/test_util.h" | 12 #include "chrome/browser/google_apis/test_util.h" |
| 13 #include "content/public/test/mock_download_item.h" | 13 #include "content/public/test/mock_download_item.h" |
| 14 #include "content/public/test/mock_download_manager.h" | 14 #include "content/public/test/mock_download_manager.h" |
| 15 #include "content/public/test/test_browser_thread.h" | 15 #include "content/public/test/test_browser_thread.h" |
| 16 #include "testing/gmock/include/gmock/gmock.h" | 16 #include "testing/gmock/include/gmock/gmock.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 18 | 18 |
| 19 using ::testing::Return; | 19 using ::testing::Return; |
| 20 using ::testing::SaveArg; | 20 using ::testing::SaveArg; |
| 21 using ::testing::_; | 21 using ::testing::_; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 } | 64 } |
| 65 | 65 |
| 66 virtual void TearDown() OVERRIDE { | 66 virtual void TearDown() OVERRIDE { |
| 67 } | 67 } |
| 68 | 68 |
| 69 protected: | 69 protected: |
| 70 base::ScopedTempDir temp_dir_; | 70 base::ScopedTempDir temp_dir_; |
| 71 MessageLoopForUI message_loop_; | 71 MessageLoopForUI message_loop_; |
| 72 content::TestBrowserThread ui_thread_; | 72 content::TestBrowserThread ui_thread_; |
| 73 scoped_refptr<content::MockDownloadManager> download_manager_; | 73 scoped_refptr<content::MockDownloadManager> download_manager_; |
| 74 MockDriveFileSystem file_system_; | 74 MockFileSystem file_system_; |
| 75 scoped_ptr<FileWriteHelper> file_write_helper_; | 75 scoped_ptr<FileWriteHelper> file_write_helper_; |
| 76 scoped_ptr<DownloadHandler> download_handler_; | 76 scoped_ptr<DownloadHandler> download_handler_; |
| 77 content::MockDownloadItem download_item_; | 77 content::MockDownloadItem download_item_; |
| 78 | 78 |
| 79 // Argument callbacks passed to the file system. | 79 // Argument callbacks passed to the file system. |
| 80 GetEntryInfoCallback get_entry_info_callback_; | 80 GetEntryInfoCallback get_entry_info_callback_; |
| 81 FileOperationCallback create_directory_callback_; | 81 FileOperationCallback create_directory_callback_; |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 TEST_F(DownloadHandlerTest, SubstituteDriveDownloadPathNonDrivePath) { | 84 TEST_F(DownloadHandlerTest, SubstituteDriveDownloadPathNonDrivePath) { |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 ASSERT_FALSE(get_entry_info_callback_.is_null()); | 275 ASSERT_FALSE(get_entry_info_callback_.is_null()); |
| 276 get_entry_info_callback_.Run(FILE_ERROR_NOT_FOUND, | 276 get_entry_info_callback_.Run(FILE_ERROR_NOT_FOUND, |
| 277 scoped_ptr<DriveEntryProto>()); | 277 scoped_ptr<DriveEntryProto>()); |
| 278 google_apis::test_util::RunBlockingPoolTask(); | 278 google_apis::test_util::RunBlockingPoolTask(); |
| 279 | 279 |
| 280 // Check the result. | 280 // Check the result. |
| 281 EXPECT_FALSE(file_exists); | 281 EXPECT_FALSE(file_exists); |
| 282 } | 282 } |
| 283 | 283 |
| 284 } // namespace drive | 284 } // namespace drive |
| OLD | NEW |