| 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" | 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 <shlobj.h> | 10 #include <shlobj.h> |
| 11 #include <windows.h> | 11 #include <windows.h> |
| 12 #elif defined(USE_NSS) | 12 #elif defined(USE_NSS) |
| 13 #include "base/nss_util.h" | 13 #include "base/nss_util.h" |
| 14 #endif | 14 #endif |
| 15 | 15 |
| 16 #include <algorithm> | 16 #include <algorithm> |
| 17 #include <string> | 17 #include <string> |
| 18 | 18 |
| 19 #include "base/file_util.h" | 19 #include "base/file_util.h" |
| 20 #include "base/format_macros.h" | 20 #include "base/format_macros.h" |
| 21 #include "base/message_loop.h" | 21 #include "base/message_loop.h" |
| 22 #include "base/path_service.h" | 22 #include "base/path_service.h" |
| 23 #include "base/process_util.h" | 23 #include "base/process_util.h" |
| 24 #include "base/string_number_conversions.h" | 24 #include "base/string_number_conversions.h" |
| 25 #include "base/string_piece.h" | 25 #include "base/string_piece.h" |
| 26 #include "base/string_util.h" |
| 26 #include "base/stringprintf.h" | 27 #include "base/stringprintf.h" |
| 27 #include "base/utf_string_conversions.h" | 28 #include "base/utf_string_conversions.h" |
| 28 #include "net/base/cookie_monster.h" | 29 #include "net/base/cookie_monster.h" |
| 29 #include "net/base/cookie_policy.h" | 30 #include "net/base/cookie_policy.h" |
| 30 #include "net/base/load_flags.h" | 31 #include "net/base/load_flags.h" |
| 31 #include "net/base/net_errors.h" | 32 #include "net/base/net_errors.h" |
| 32 #include "net/base/net_log.h" | 33 #include "net/base/net_log.h" |
| 33 #include "net/base/net_log_unittest.h" | 34 #include "net/base/net_log_unittest.h" |
| 34 #include "net/base/net_module.h" | 35 #include "net/base/net_module.h" |
| 35 #include "net/base/net_util.h" | 36 #include "net/base/net_util.h" |
| (...skipping 2626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2662 | 2663 |
| 2663 TestDelegate d; | 2664 TestDelegate d; |
| 2664 TestURLRequest | 2665 TestURLRequest |
| 2665 req(test_server_.GetURL("echoheaderoverride?User-Agent"), &d); | 2666 req(test_server_.GetURL("echoheaderoverride?User-Agent"), &d); |
| 2666 req.set_context(new TestURLRequestContext()); | 2667 req.set_context(new TestURLRequestContext()); |
| 2667 net::HttpRequestHeaders headers; | 2668 net::HttpRequestHeaders headers; |
| 2668 headers.SetHeader(net::HttpRequestHeaders::kUserAgent, "Lynx (textmode)"); | 2669 headers.SetHeader(net::HttpRequestHeaders::kUserAgent, "Lynx (textmode)"); |
| 2669 req.SetExtraRequestHeaders(headers); | 2670 req.SetExtraRequestHeaders(headers); |
| 2670 req.Start(); | 2671 req.Start(); |
| 2671 MessageLoop::current()->Run(); | 2672 MessageLoop::current()->Run(); |
| 2672 EXPECT_EQ(std::string("Lynx (textmode)"), d.data_received()); | 2673 // If the net tests are being run with ChromeFrame then we need to allow for |
| 2674 // the 'chromeframe' suffix which is added to the user agent in outgoing HTTP |
| 2675 // requests. |
| 2676 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode)", true)); |
| 2673 } | 2677 } |
| OLD | NEW |