OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shlobj.h> | 9 #include <shlobj.h> |
10 #endif | 10 #endif |
(...skipping 5905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5916 TEST_F(URLRequestTestHTTP, DefaultUserAgent) { | 5916 TEST_F(URLRequestTestHTTP, DefaultUserAgent) { |
5917 ASSERT_TRUE(test_server_.Start()); | 5917 ASSERT_TRUE(test_server_.Start()); |
5918 | 5918 |
5919 TestDelegate d; | 5919 TestDelegate d; |
5920 URLRequest req(test_server_.GetURL("echoheader?User-Agent"), | 5920 URLRequest req(test_server_.GetURL("echoheader?User-Agent"), |
5921 DEFAULT_PRIORITY, | 5921 DEFAULT_PRIORITY, |
5922 &d, | 5922 &d, |
5923 &default_context_); | 5923 &default_context_); |
5924 req.Start(); | 5924 req.Start(); |
5925 base::RunLoop().Run(); | 5925 base::RunLoop().Run(); |
5926 EXPECT_EQ(req.context()->http_user_agent_settings()->GetUserAgent(req.url()), | 5926 EXPECT_EQ(req.context()->http_user_agent_settings()->GetUserAgent(), |
5927 d.data_received()); | 5927 d.data_received()); |
5928 } | 5928 } |
5929 | 5929 |
5930 // Check that if request overrides the User-Agent header, | 5930 // Check that if request overrides the User-Agent header, |
5931 // the default is not appended. | 5931 // the default is not appended. |
5932 TEST_F(URLRequestTestHTTP, OverrideUserAgent) { | 5932 TEST_F(URLRequestTestHTTP, OverrideUserAgent) { |
5933 ASSERT_TRUE(test_server_.Start()); | 5933 ASSERT_TRUE(test_server_.Start()); |
5934 | 5934 |
5935 TestDelegate d; | 5935 TestDelegate d; |
5936 URLRequest req(test_server_.GetURL("echoheader?User-Agent"), | 5936 URLRequest req(test_server_.GetURL("echoheader?User-Agent"), |
(...skipping 1656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7593 | 7593 |
7594 EXPECT_FALSE(r.is_pending()); | 7594 EXPECT_FALSE(r.is_pending()); |
7595 EXPECT_EQ(1, d->response_started_count()); | 7595 EXPECT_EQ(1, d->response_started_count()); |
7596 EXPECT_FALSE(d->received_data_before_response()); | 7596 EXPECT_FALSE(d->received_data_before_response()); |
7597 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); | 7597 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); |
7598 } | 7598 } |
7599 } | 7599 } |
7600 #endif // !defined(DISABLE_FTP_SUPPORT) | 7600 #endif // !defined(DISABLE_FTP_SUPPORT) |
7601 | 7601 |
7602 } // namespace net | 7602 } // namespace net |
OLD | NEW |