| 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/files/file_path.h" | 5 #include "base/files/file_path.h" |
| 6 #include "base/files/scoped_temp_dir.h" | 6 #include "base/files/scoped_temp_dir.h" |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "content/browser/download/download_file_factory.h" | 9 #include "content/browser/download/download_file_factory.h" |
| 10 #include "content/browser/download/download_file_impl.h" | 10 #include "content/browser/download/download_file_impl.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 void SetUpServer() { | 74 void SetUpServer() { |
| 75 base::FilePath mock_base(GetTestFilePath("download", "")); | 75 base::FilePath mock_base(GetTestFilePath("download", "")); |
| 76 BrowserThread::PostTask( | 76 BrowserThread::PostTask( |
| 77 BrowserThread::IO, FROM_HERE, | 77 BrowserThread::IO, FROM_HERE, |
| 78 base::Bind( | 78 base::Bind( |
| 79 &net::URLRequestMockHTTPJob::AddUrlHandlers, mock_base, | 79 &net::URLRequestMockHTTPJob::AddUrlHandlers, mock_base, |
| 80 make_scoped_refptr(content::BrowserThread::GetBlockingPool()))); | 80 make_scoped_refptr(content::BrowserThread::GetBlockingPool()))); |
| 81 } | 81 } |
| 82 | 82 |
| 83 const base::FilePath& downloads_directory() const { | 83 const base::FilePath& downloads_directory() const { |
| 84 return downloads_directory_.path(); | 84 return downloads_directory_.GetPath(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 private: | 87 private: |
| 88 base::ScopedTempDir downloads_directory_; | 88 base::ScopedTempDir downloads_directory_; |
| 89 | 89 |
| 90 DISALLOW_COPY_AND_ASSIGN(DragDownloadFileTest); | 90 DISALLOW_COPY_AND_ASSIGN(DragDownloadFileTest); |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 IN_PROC_BROWSER_TEST_F(DragDownloadFileTest, DragDownloadFileTest_NetError) { | 93 IN_PROC_BROWSER_TEST_F(DragDownloadFileTest, DragDownloadFileTest_NetError) { |
| 94 base::FilePath name(downloads_directory().AppendASCII( | 94 base::FilePath name(downloads_directory().AppendASCII( |
| (...skipping 30 matching lines...) Expand all Loading... |
| 125 .WillOnce(InvokeWithoutArgs(this, &DragDownloadFileTest::Succeed)); | 125 .WillOnce(InvokeWithoutArgs(this, &DragDownloadFileTest::Succeed)); |
| 126 ON_CALL(*observer.get(), OnDownloadAborted()) | 126 ON_CALL(*observer.get(), OnDownloadAborted()) |
| 127 .WillByDefault(InvokeWithoutArgs(this, &DragDownloadFileTest::FailFast)); | 127 .WillByDefault(InvokeWithoutArgs(this, &DragDownloadFileTest::FailFast)); |
| 128 file->Start(observer.get()); | 128 file->Start(observer.get()); |
| 129 RunMessageLoop(); | 129 RunMessageLoop(); |
| 130 } | 130 } |
| 131 | 131 |
| 132 // TODO(benjhayden): Test Stop(). | 132 // TODO(benjhayden): Test Stop(). |
| 133 | 133 |
| 134 } // namespace content | 134 } // namespace content |
| OLD | NEW |