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

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

Issue 191093002: Simplify the user agent code some more since after r255534 it's not affected by the site's URL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: patchset 15 which works Created 6 years, 9 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_http_job.cc ('k') | webkit/common/user_agent/user_agent.h » ('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 5905 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « net/url_request/url_request_http_job.cc ('k') | webkit/common/user_agent/user_agent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698