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

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: address comments from xians Created 6 years, 11 months 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
« no previous file with comments | « net/url_request/url_request_context.cc ('k') | sync/internal_api/http_bridge.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5925 matching lines...) Expand 10 before | Expand all | Expand 10 after
5936 TEST_F(URLRequestTestHTTP, DefaultUserAgent) { 5936 TEST_F(URLRequestTestHTTP, DefaultUserAgent) {
5937 ASSERT_TRUE(test_server_.Start()); 5937 ASSERT_TRUE(test_server_.Start());
5938 5938
5939 TestDelegate d; 5939 TestDelegate d;
5940 URLRequest req(test_server_.GetURL("echoheader?User-Agent"), 5940 URLRequest req(test_server_.GetURL("echoheader?User-Agent"),
5941 DEFAULT_PRIORITY, 5941 DEFAULT_PRIORITY,
5942 &d, 5942 &d,
5943 &default_context_); 5943 &default_context_);
5944 req.Start(); 5944 req.Start();
5945 base::RunLoop().Run(); 5945 base::RunLoop().Run();
5946 EXPECT_EQ(req.context()->GetUserAgent(req.url()), d.data_received()); 5946 EXPECT_EQ(req.context()->http_user_agent_settings()->GetUserAgent(req.url()),
5947 d.data_received());
5947 } 5948 }
5948 5949
5949 // Check that if request overrides the User-Agent header, 5950 // Check that if request overrides the User-Agent header,
5950 // the default is not appended. 5951 // the default is not appended.
5951 TEST_F(URLRequestTestHTTP, OverrideUserAgent) { 5952 TEST_F(URLRequestTestHTTP, OverrideUserAgent) {
5952 ASSERT_TRUE(test_server_.Start()); 5953 ASSERT_TRUE(test_server_.Start());
5953 5954
5954 TestDelegate d; 5955 TestDelegate d;
5955 URLRequest req(test_server_.GetURL("echoheader?User-Agent"), 5956 URLRequest req(test_server_.GetURL("echoheader?User-Agent"),
5956 DEFAULT_PRIORITY, 5957 DEFAULT_PRIORITY,
(...skipping 1658 matching lines...) Expand 10 before | Expand all | Expand 10 after
7615 7616
7616 EXPECT_FALSE(r.is_pending()); 7617 EXPECT_FALSE(r.is_pending());
7617 EXPECT_EQ(1, d->response_started_count()); 7618 EXPECT_EQ(1, d->response_started_count());
7618 EXPECT_FALSE(d->received_data_before_response()); 7619 EXPECT_FALSE(d->received_data_before_response());
7619 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); 7620 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size));
7620 } 7621 }
7621 } 7622 }
7622 #endif // !defined(DISABLE_FTP_SUPPORT) 7623 #endif // !defined(DISABLE_FTP_SUPPORT)
7623 7624
7624 } // namespace net 7625 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_context.cc ('k') | sync/internal_api/http_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698