| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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" | |
| 6 | |
| 7 #include "build/build_config.h" | 5 #include "build/build_config.h" |
| 8 | 6 |
| 9 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 10 #include <shlobj.h> | 8 #include <shlobj.h> |
| 11 #include <windows.h> | 9 #include <windows.h> |
| 12 #elif defined(USE_NSS) | 10 #elif defined(USE_NSS) |
| 13 #include "base/nss_util.h" | 11 #include "base/nss_util.h" |
| 14 #endif | 12 #endif |
| 15 | 13 |
| 16 #include <algorithm> | 14 #include <algorithm> |
| (...skipping 24 matching lines...) Expand all Loading... |
| 41 #include "net/http/http_cache.h" | 39 #include "net/http/http_cache.h" |
| 42 #include "net/http/http_network_layer.h" | 40 #include "net/http/http_network_layer.h" |
| 43 #include "net/http/http_request_headers.h" | 41 #include "net/http/http_request_headers.h" |
| 44 #include "net/http/http_response_headers.h" | 42 #include "net/http/http_response_headers.h" |
| 45 #include "net/proxy/proxy_service.h" | 43 #include "net/proxy/proxy_service.h" |
| 46 #include "net/test/test_server.h" | 44 #include "net/test/test_server.h" |
| 47 #include "net/url_request/url_request.h" | 45 #include "net/url_request/url_request.h" |
| 48 #include "net/url_request/url_request_file_dir_job.h" | 46 #include "net/url_request/url_request_file_dir_job.h" |
| 49 #include "net/url_request/url_request_http_job.h" | 47 #include "net/url_request/url_request_http_job.h" |
| 50 #include "net/url_request/url_request_test_job.h" | 48 #include "net/url_request/url_request_test_job.h" |
| 49 #include "net/url_request/url_request_test_util.h" |
| 51 #include "testing/gtest/include/gtest/gtest.h" | 50 #include "testing/gtest/include/gtest/gtest.h" |
| 52 #include "testing/platform_test.h" | 51 #include "testing/platform_test.h" |
| 53 | 52 |
| 54 using base::Time; | 53 using base::Time; |
| 55 | 54 |
| 56 namespace { | 55 namespace { |
| 57 | 56 |
| 58 const string16 kChrome(ASCIIToUTF16("chrome")); | 57 const string16 kChrome(ASCIIToUTF16("chrome")); |
| 59 const string16 kSecret(ASCIIToUTF16("secret")); | 58 const string16 kSecret(ASCIIToUTF16("secret")); |
| 60 const string16 kUser(ASCIIToUTF16("user")); | 59 const string16 kUser(ASCIIToUTF16("user")); |
| (...skipping 2669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2730 net::HttpRequestHeaders headers; | 2729 net::HttpRequestHeaders headers; |
| 2731 headers.SetHeader(net::HttpRequestHeaders::kUserAgent, "Lynx (textmode)"); | 2730 headers.SetHeader(net::HttpRequestHeaders::kUserAgent, "Lynx (textmode)"); |
| 2732 req.SetExtraRequestHeaders(headers); | 2731 req.SetExtraRequestHeaders(headers); |
| 2733 req.Start(); | 2732 req.Start(); |
| 2734 MessageLoop::current()->Run(); | 2733 MessageLoop::current()->Run(); |
| 2735 // If the net tests are being run with ChromeFrame then we need to allow for | 2734 // If the net tests are being run with ChromeFrame then we need to allow for |
| 2736 // the 'chromeframe' suffix which is added to the user agent in outgoing HTTP | 2735 // the 'chromeframe' suffix which is added to the user agent in outgoing HTTP |
| 2737 // requests. | 2736 // requests. |
| 2738 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode)", true)); | 2737 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode)", true)); |
| 2739 } | 2738 } |
| OLD | NEW |