| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "net/url_request/url_request_unittest.h" | 5 #include "net/url_request/url_request_unittest.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 #include "net/proxy/proxy_service.h" | 41 #include "net/proxy/proxy_service.h" |
| 42 #include "net/test/test_server.h" | 42 #include "net/test/test_server.h" |
| 43 #include "net/url_request/url_request.h" | 43 #include "net/url_request/url_request.h" |
| 44 #include "net/url_request/url_request_file_dir_job.h" | 44 #include "net/url_request/url_request_file_dir_job.h" |
| 45 #include "net/url_request/url_request_http_job.h" | 45 #include "net/url_request/url_request_http_job.h" |
| 46 #include "net/url_request/url_request_test_job.h" | 46 #include "net/url_request/url_request_test_job.h" |
| 47 #include "testing/gtest/include/gtest/gtest.h" | 47 #include "testing/gtest/include/gtest/gtest.h" |
| 48 #include "testing/platform_test.h" | 48 #include "testing/platform_test.h" |
| 49 | 49 |
| 50 using base::Time; | 50 using base::Time; |
| 51 using net::kHTTPDefaultPort; |
| 52 using net::FTPTestServer; |
| 53 using net::HTTPTestServer; |
| 54 using net::HTTPSTestServer; |
| 51 | 55 |
| 52 namespace { | 56 namespace { |
| 53 | 57 |
| 54 const string16 kChrome(ASCIIToUTF16("chrome")); | 58 const string16 kChrome(ASCIIToUTF16("chrome")); |
| 55 const string16 kSecret(ASCIIToUTF16("secret")); | 59 const string16 kSecret(ASCIIToUTF16("secret")); |
| 56 const string16 kUser(ASCIIToUTF16("user")); | 60 const string16 kUser(ASCIIToUTF16("user")); |
| 57 | 61 |
| 58 base::StringPiece TestNetResourceProvider(int key) { | 62 base::StringPiece TestNetResourceProvider(int key) { |
| 59 return "header"; | 63 return "header"; |
| 60 } | 64 } |
| (...skipping 2495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2556 TestURLRequest | 2560 TestURLRequest |
| 2557 req(server_->TestServerPage("echoheaderoverride?Accept-Charset"), &d); | 2561 req(server_->TestServerPage("echoheaderoverride?Accept-Charset"), &d); |
| 2558 req.set_context(new TestURLRequestContext()); | 2562 req.set_context(new TestURLRequestContext()); |
| 2559 net::HttpRequestHeaders headers; | 2563 net::HttpRequestHeaders headers; |
| 2560 headers.SetHeader(net::HttpRequestHeaders::kAcceptCharset, "koi-8r"); | 2564 headers.SetHeader(net::HttpRequestHeaders::kAcceptCharset, "koi-8r"); |
| 2561 req.SetExtraRequestHeaders(headers); | 2565 req.SetExtraRequestHeaders(headers); |
| 2562 req.Start(); | 2566 req.Start(); |
| 2563 MessageLoop::current()->Run(); | 2567 MessageLoop::current()->Run(); |
| 2564 EXPECT_EQ(std::string("koi-8r"), d.data_received()); | 2568 EXPECT_EQ(std::string("koi-8r"), d.data_received()); |
| 2565 } | 2569 } |
| OLD | NEW |