| 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 "base/file_path.h" | 5 #include "base/file_path.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "content/browser/download/download_file_factory.h" | 8 #include "content/browser/download/download_file_factory.h" |
| 9 #include "content/browser/download/download_file_impl.h" | 9 #include "content/browser/download/download_file_impl.h" |
| 10 #include "content/browser/download/download_item_impl.h" | 10 #include "content/browser/download/download_item_impl.h" |
| 11 #include "content/browser/download/download_manager_impl.h" | 11 #include "content/browser/download/download_manager_impl.h" |
| 12 #include "content/browser/download/drag_download_file.h" | 12 #include "content/browser/download/drag_download_file.h" |
| 13 #include "content/browser/download/drag_download_util.h" | 13 #include "content/browser/download/drag_download_util.h" |
| 14 #include "content/browser/power_save_blocker.h" | 14 #include "content/browser/power_save_blocker.h" |
| 15 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" | 15 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" |
| 16 #include "content/browser/web_contents/web_contents_impl.h" | 16 #include "content/browser/web_contents/web_contents_impl.h" |
| 17 #include "content/public/browser/content_browser_client.h" | 17 #include "content/public/browser/content_browser_client.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 BrowserThread::PostTask( | 77 BrowserThread::PostTask( |
| 78 BrowserThread::IO, FROM_HERE, | 78 BrowserThread::IO, FROM_HERE, |
| 79 base::Bind(&URLRequestMockHTTPJob::AddUrlHandler, mock_base)); | 79 base::Bind(&URLRequestMockHTTPJob::AddUrlHandler, mock_base)); |
| 80 } | 80 } |
| 81 | 81 |
| 82 const FilePath& downloads_directory() const { | 82 const FilePath& downloads_directory() const { |
| 83 return downloads_directory_.path(); | 83 return downloads_directory_.path(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 private: | 86 private: |
| 87 ScopedTempDir downloads_directory_; | 87 base::ScopedTempDir downloads_directory_; |
| 88 | 88 |
| 89 DISALLOW_COPY_AND_ASSIGN(DragDownloadFileTest); | 89 DISALLOW_COPY_AND_ASSIGN(DragDownloadFileTest); |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 IN_PROC_BROWSER_TEST_F(DragDownloadFileTest, DragDownloadFileTest_NetError) { | 92 IN_PROC_BROWSER_TEST_F(DragDownloadFileTest, DragDownloadFileTest_NetError) { |
| 93 FilePath name(downloads_directory().AppendASCII( | 93 FilePath name(downloads_directory().AppendASCII( |
| 94 "DragDownloadFileTest_NetError.txt")); | 94 "DragDownloadFileTest_NetError.txt")); |
| 95 GURL url(URLRequestMockHTTPJob::GetMockUrl(FilePath(FILE_PATH_LITERAL( | 95 GURL url(URLRequestMockHTTPJob::GetMockUrl(FilePath(FILE_PATH_LITERAL( |
| 96 "download-test.lib")))); | 96 "download-test.lib")))); |
| 97 Referrer referrer; | 97 Referrer referrer; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 this, &DragDownloadFileTest::Succeed)); | 131 this, &DragDownloadFileTest::Succeed)); |
| 132 ON_CALL(*observer, OnDownloadAborted()).WillByDefault(InvokeWithoutArgs( | 132 ON_CALL(*observer, OnDownloadAborted()).WillByDefault(InvokeWithoutArgs( |
| 133 this, &DragDownloadFileTest::FailFast)); | 133 this, &DragDownloadFileTest::FailFast)); |
| 134 file->Start(observer); | 134 file->Start(observer); |
| 135 RunMessageLoop(); | 135 RunMessageLoop(); |
| 136 } | 136 } |
| 137 | 137 |
| 138 // TODO(benjhayden): Test Stop(). | 138 // TODO(benjhayden): Test Stop(). |
| 139 | 139 |
| 140 } // namespace content | 140 } // namespace content |
| OLD | NEW |