Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: net/url_request/url_request_unittest.cc

Issue 83433008: Cleanup: Remove legacy accessors from URLRequestContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 5789 matching lines...) Expand 10 before | Expand all | Expand 10 after
5800 TEST_F(URLRequestTestHTTP, DefaultUserAgent) { 5800 TEST_F(URLRequestTestHTTP, DefaultUserAgent) {
5801 ASSERT_TRUE(test_server_.Start()); 5801 ASSERT_TRUE(test_server_.Start());
5802 5802
5803 TestDelegate d; 5803 TestDelegate d;
5804 URLRequest req(test_server_.GetURL("echoheader?User-Agent"), 5804 URLRequest req(test_server_.GetURL("echoheader?User-Agent"),
5805 DEFAULT_PRIORITY, 5805 DEFAULT_PRIORITY,
5806 &d, 5806 &d,
5807 &default_context_); 5807 &default_context_);
5808 req.Start(); 5808 req.Start();
5809 base::RunLoop().Run(); 5809 base::RunLoop().Run();
5810 EXPECT_EQ(req.context()->GetUserAgent(req.url()), d.data_received()); 5810 EXPECT_EQ(req.context()->http_user_agent_settings()->GetUserAgent(req.url()),
5811 d.data_received());
5811 } 5812 }
5812 5813
5813 // Check that if request overrides the User-Agent header, 5814 // Check that if request overrides the User-Agent header,
5814 // the default is not appended. 5815 // the default is not appended.
5815 TEST_F(URLRequestTestHTTP, OverrideUserAgent) { 5816 TEST_F(URLRequestTestHTTP, OverrideUserAgent) {
5816 ASSERT_TRUE(test_server_.Start()); 5817 ASSERT_TRUE(test_server_.Start());
5817 5818
5818 TestDelegate d; 5819 TestDelegate d;
5819 URLRequest req(test_server_.GetURL("echoheader?User-Agent"), 5820 URLRequest req(test_server_.GetURL("echoheader?User-Agent"),
5820 DEFAULT_PRIORITY, 5821 DEFAULT_PRIORITY,
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after
7341 7342
7342 EXPECT_FALSE(r.is_pending()); 7343 EXPECT_FALSE(r.is_pending());
7343 EXPECT_EQ(1, d->response_started_count()); 7344 EXPECT_EQ(1, d->response_started_count());
7344 EXPECT_FALSE(d->received_data_before_response()); 7345 EXPECT_FALSE(d->received_data_before_response());
7345 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); 7346 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size));
7346 } 7347 }
7347 } 7348 }
7348 #endif // !defined(DISABLE_FTP_SUPPORT) 7349 #endif // !defined(DISABLE_FTP_SUPPORT)
7349 7350
7350 } // namespace net 7351 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698