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 5791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5802 TEST_F(URLRequestTestHTTP, DefaultUserAgent) { | 5802 TEST_F(URLRequestTestHTTP, DefaultUserAgent) { |
5803 ASSERT_TRUE(test_server_.Start()); | 5803 ASSERT_TRUE(test_server_.Start()); |
5804 | 5804 |
5805 TestDelegate d; | 5805 TestDelegate d; |
5806 URLRequest req(test_server_.GetURL("echoheader?User-Agent"), | 5806 URLRequest req(test_server_.GetURL("echoheader?User-Agent"), |
5807 DEFAULT_PRIORITY, | 5807 DEFAULT_PRIORITY, |
5808 &d, | 5808 &d, |
5809 &default_context_); | 5809 &default_context_); |
5810 req.Start(); | 5810 req.Start(); |
5811 base::RunLoop().Run(); | 5811 base::RunLoop().Run(); |
5812 EXPECT_EQ(req.context()->GetUserAgent(req.url()), d.data_received()); | 5812 EXPECT_EQ(req.context()->http_user_agent_settings()->GetUserAgent(req.url()), |
| 5813 d.data_received()); |
5813 } | 5814 } |
5814 | 5815 |
5815 // Check that if request overrides the User-Agent header, | 5816 // Check that if request overrides the User-Agent header, |
5816 // the default is not appended. | 5817 // the default is not appended. |
5817 TEST_F(URLRequestTestHTTP, OverrideUserAgent) { | 5818 TEST_F(URLRequestTestHTTP, OverrideUserAgent) { |
5818 ASSERT_TRUE(test_server_.Start()); | 5819 ASSERT_TRUE(test_server_.Start()); |
5819 | 5820 |
5820 TestDelegate d; | 5821 TestDelegate d; |
5821 URLRequest req(test_server_.GetURL("echoheader?User-Agent"), | 5822 URLRequest req(test_server_.GetURL("echoheader?User-Agent"), |
5822 DEFAULT_PRIORITY, | 5823 DEFAULT_PRIORITY, |
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7343 | 7344 |
7344 EXPECT_FALSE(r.is_pending()); | 7345 EXPECT_FALSE(r.is_pending()); |
7345 EXPECT_EQ(1, d->response_started_count()); | 7346 EXPECT_EQ(1, d->response_started_count()); |
7346 EXPECT_FALSE(d->received_data_before_response()); | 7347 EXPECT_FALSE(d->received_data_before_response()); |
7347 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); | 7348 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); |
7348 } | 7349 } |
7349 } | 7350 } |
7350 #endif // !defined(DISABLE_FTP_SUPPORT) | 7351 #endif // !defined(DISABLE_FTP_SUPPORT) |
7351 | 7352 |
7352 } // namespace net | 7353 } // namespace net |
OLD | NEW |