Index: net/url_request/url_request_unittest.cc |
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc |
index 406dabf945dacbd0446bec0ecf7c50f2956c16ee..3e309dff023704b6be06f10cb0974a5bf1dcc697 100644 |
--- a/net/url_request/url_request_unittest.cc |
+++ b/net/url_request/url_request_unittest.cc |
@@ -52,6 +52,8 @@ |
#include "net/proxy/proxy_service.h" |
#include "net/socket/ssl_client_socket.h" |
#include "net/test/test_server.h" |
+#include "net/url_request/data_protocol_handler.h" |
+#include "net/url_request/file_protocol_handler.h" |
#include "net/url_request/ftp_protocol_handler.h" |
#include "net/url_request/url_request.h" |
#include "net/url_request/url_request_file_dir_job.h" |
@@ -2433,6 +2435,10 @@ TEST_F(URLRequestTest, AboutBlankTest) { |
} |
TEST_F(URLRequestTest, DataURLImageTest) { |
+ URLRequestJobFactory job_factory; |
+ job_factory.SetProtocolHandler("data", new DataProtocolHandler()); |
+ default_context_.set_job_factory(&job_factory); |
+ |
TestDelegate d; |
{ |
// Use our nice little Chrome logo. |
@@ -2477,6 +2483,10 @@ TEST_F(URLRequestTest, FileTest) { |
PathService::Get(base::FILE_EXE, &app_path); |
GURL app_url = FilePathToFileURL(app_path); |
+ URLRequestJobFactory job_factory; |
+ job_factory.SetProtocolHandler("file", new FileProtocolHandler()); |
+ default_context_.set_job_factory(&job_factory); |
+ |
TestDelegate d; |
{ |
URLRequest r(app_url, &d, &default_context_); |
@@ -2517,6 +2527,10 @@ TEST_F(URLRequestTest, FileTestFullSpecifiedRange) { |
std::string partial_buffer_string(buffer.get() + first_byte_position, |
buffer.get() + last_byte_position + 1); |
+ URLRequestJobFactory job_factory; |
+ job_factory.SetProtocolHandler("file", new FileProtocolHandler()); |
+ default_context_.set_job_factory(&job_factory); |
+ |
TestDelegate d; |
{ |
URLRequest r(temp_url, &d, &default_context_); |
@@ -2561,6 +2575,10 @@ TEST_F(URLRequestTest, FileTestHalfSpecifiedRange) { |
std::string partial_buffer_string(buffer.get() + first_byte_position, |
buffer.get() + last_byte_position + 1); |
+ URLRequestJobFactory job_factory; |
+ job_factory.SetProtocolHandler("file", new FileProtocolHandler()); |
+ default_context_.set_job_factory(&job_factory); |
+ |
TestDelegate d; |
{ |
URLRequest r(temp_url, &d, &default_context_); |
@@ -2782,6 +2800,10 @@ TEST_F(URLRequestTest, FileDirRedirectNoCrash) { |
path = path.Append(FILE_PATH_LITERAL("data")); |
path = path.Append(FILE_PATH_LITERAL("url_request_unittest")); |
+ URLRequestJobFactory job_factory; |
+ job_factory.SetProtocolHandler("file", new FileProtocolHandler()); |
+ default_context_.set_job_factory(&job_factory); |
+ |
TestDelegate d; |
URLRequest req(FilePathToFileURL(path), &d, &default_context_); |
req.Start(); |
@@ -2809,6 +2831,10 @@ TEST_F(URLRequestTest, FileDirRedirectSingleSlash) { |
TEST_F(URLRequestTestHTTP, RestrictRedirects) { |
ASSERT_TRUE(test_server_.Start()); |
+ URLRequestJobFactory job_factory; |
+ job_factory.SetProtocolHandler("file", new FileProtocolHandler()); |
+ default_context_.set_job_factory(&job_factory); |
+ |
TestDelegate d; |
URLRequest req(test_server_.GetURL( |
"files/redirect-to-file.html"), &d, &default_context_); |
@@ -4171,9 +4197,6 @@ TEST_F(URLRequestTestFTP, UnsafePort) { |
URLRequestJobFactoryImpl job_factory; |
GURL url("ftp://127.0.0.1:7"); |
- FtpProtocolHandler ftp_protocol_handler( |
- default_context_.ftp_transaction_factory(), |
- default_context_.ftp_auth_cache()); |
job_factory.SetProtocolHandler( |
"ftp", |
new FtpProtocolHandler(default_context_.ftp_transaction_factory(), |