Index: content/browser/download/download_browsertest.cc |
diff --git a/content/browser/download/download_browsertest.cc b/content/browser/download/download_browsertest.cc |
index eeacac169956c4bdab52ca1aa7edbce78baf3eec..bfcd746c7481ae484f6855212009730352085b35 100644 |
--- a/content/browser/download/download_browsertest.cc |
+++ b/content/browser/download/download_browsertest.cc |
@@ -9,6 +9,7 @@ |
#include "base/files/file_path.h" |
#include "base/files/file_util.h" |
#include "base/files/scoped_temp_dir.h" |
+#include "base/memory/ref_counted.h" |
#include "base/strings/stringprintf.h" |
#include "base/strings/utf_string_conversions.h" |
#include "base/threading/platform_thread.h" |
@@ -33,12 +34,12 @@ |
#include "content/shell/browser/shell_browser_context.h" |
#include "content/shell/browser/shell_download_manager_delegate.h" |
#include "content/shell/browser/shell_network_delegate.h" |
-#include "content/test/net/url_request_mock_http_job.h" |
#include "content/test/net/url_request_slow_download_job.h" |
#include "net/test/embedded_test_server/embedded_test_server.h" |
#include "net/test/embedded_test_server/http_request.h" |
#include "net/test/embedded_test_server/http_response.h" |
#include "net/test/spawned_test_server/spawned_test_server.h" |
+#include "net/test/url_request/url_request_mock_http_job.h" |
#include "testing/gmock/include/gmock/gmock.h" |
#include "testing/gtest/include/gtest/gtest.h" |
#include "url/gurl.h" |
@@ -588,8 +589,12 @@ class DownloadContentTest : public ContentBrowserTest { |
base::Bind(&URLRequestSlowDownloadJob::AddUrlHandler)); |
base::FilePath mock_base(GetTestFilePath("download", "")); |
BrowserThread::PostTask( |
- BrowserThread::IO, FROM_HERE, |
- base::Bind(&URLRequestMockHTTPJob::AddUrlHandler, mock_base)); |
+ BrowserThread::IO, |
+ FROM_HERE, |
+ base::Bind( |
+ &net::URLRequestMockHTTPJob::AddUrlHandler, |
+ mock_base, |
+ make_scoped_refptr(content::BrowserThread::GetBlockingPool()))); |
} |
TestShellDownloadManagerDelegate* GetDownloadManagerDelegate() { |
@@ -801,7 +806,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, MultiDownload) { |
// Start the second download and wait until it's done. |
base::FilePath file(FILE_PATH_LITERAL("download-test.lib")); |
- GURL url(URLRequestMockHTTPJob::GetMockUrl(file)); |
+ GURL url(net::URLRequestMockHTTPJob::GetMockUrl(file)); |
// Download the file and wait. |
NavigateToURLAndWaitForDownload(shell(), url, DownloadItem::COMPLETE); |
@@ -856,7 +861,8 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, DownloadOctetStream) { |
PluginServiceImpl::GetInstance()->RegisterInternalPlugin(plugin_info, false); |
// The following is served with a Content-Type of application/octet-stream. |
- GURL url(URLRequestMockHTTPJob::GetMockUrl(base::FilePath(kTestFilePath))); |
+ GURL url( |
+ net::URLRequestMockHTTPJob::GetMockUrl(base::FilePath(kTestFilePath))); |
NavigateToURLAndWaitForDownload(shell(), url, DownloadItem::COMPLETE); |
} |
#endif |
@@ -873,7 +879,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, CancelAtFinalRename) { |
// Create a download |
base::FilePath file(FILE_PATH_LITERAL("download-test.lib")); |
- NavigateToURL(shell(), URLRequestMockHTTPJob::GetMockUrl(file)); |
+ NavigateToURL(shell(), net::URLRequestMockHTTPJob::GetMockUrl(file)); |
// Wait until the first (intermediate file) rename and execute the callback. |
file_factory->WaitForSomeCallback(); |
@@ -922,7 +928,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, CancelAtRelease) { |
// Create a download |
base::FilePath file(FILE_PATH_LITERAL("download-test.lib")); |
- NavigateToURL(shell(), URLRequestMockHTTPJob::GetMockUrl(file)); |
+ NavigateToURL(shell(), net::URLRequestMockHTTPJob::GetMockUrl(file)); |
// Wait until the first (intermediate file) rename and execute the callback. |
file_factory->WaitForSomeCallback(); |
@@ -1032,7 +1038,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, ShutdownAtRelease) { |
// Create a download |
base::FilePath file(FILE_PATH_LITERAL("download-test.lib")); |
- NavigateToURL(shell(), URLRequestMockHTTPJob::GetMockUrl(file)); |
+ NavigateToURL(shell(), net::URLRequestMockHTTPJob::GetMockUrl(file)); |
// Wait until the first (intermediate file) rename and execute the callback. |
file_factory->WaitForSomeCallback(); |
@@ -1339,7 +1345,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, ResumeWithFileInitError) { |
base::CommandLine::ForCurrentProcess()->AppendSwitch( |
switches::kEnableDownloadResumption); |
base::FilePath file(FILE_PATH_LITERAL("download-test.lib")); |
- GURL url(URLRequestMockHTTPJob::GetMockUrl(file)); |
+ GURL url(net::URLRequestMockHTTPJob::GetMockUrl(file)); |
// Setup the error injector. |
scoped_refptr<TestFileErrorInjector> injector( |
@@ -1390,7 +1396,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, |
base::CommandLine::ForCurrentProcess()->AppendSwitch( |
switches::kEnableDownloadResumption); |
base::FilePath file(FILE_PATH_LITERAL("download-test.lib")); |
- GURL url(URLRequestMockHTTPJob::GetMockUrl(file)); |
+ GURL url(net::URLRequestMockHTTPJob::GetMockUrl(file)); |
// Setup the error injector. |
scoped_refptr<TestFileErrorInjector> injector( |
@@ -1442,7 +1448,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, ResumeWithFileFinalRenameError) { |
base::CommandLine::ForCurrentProcess()->AppendSwitch( |
switches::kEnableDownloadResumption); |
base::FilePath file(FILE_PATH_LITERAL("download-test.lib")); |
- GURL url(URLRequestMockHTTPJob::GetMockUrl(file)); |
+ GURL url(net::URLRequestMockHTTPJob::GetMockUrl(file)); |
// Setup the error injector. |
scoped_refptr<TestFileErrorInjector> injector( |
@@ -1557,7 +1563,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, RemoveDownload) { |
{ |
// Start the second download and wait until it's done. |
base::FilePath file2(FILE_PATH_LITERAL("download-test.lib")); |
- GURL url2(URLRequestMockHTTPJob::GetMockUrl(file2)); |
+ GURL url2(net::URLRequestMockHTTPJob::GetMockUrl(file2)); |
scoped_ptr<DownloadTestObserver> completion_observer( |
CreateWaiter(shell(), 1)); |
DownloadItem* download(StartDownloadAndReturnItem(url2)); |