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

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

Issue 889463003: GURL::Replacements methods accept a StringPiece instead of std::string&. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase (fixed some merge conflicts). Created 5 years, 10 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
« no previous file with comments | « net/http/http_stream_factory_impl.cc ('k') | net/websockets/websocket_end_to_end_test.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 5971 matching lines...) Expand 10 before | Expand all | Expand 10 after
5982 // (without user intervention since identity is embedded in the URL). 5982 // (without user intervention since identity is embedded in the URL).
5983 { 5983 {
5984 TestNetworkDelegate network_delegate; // Must outlive URLRequest. 5984 TestNetworkDelegate network_delegate; // Must outlive URLRequest.
5985 TestURLRequestContext context(true); 5985 TestURLRequestContext context(true);
5986 context.set_network_delegate(&network_delegate); 5986 context.set_network_delegate(&network_delegate);
5987 context.Init(); 5987 context.Init();
5988 5988
5989 TestDelegate d; 5989 TestDelegate d;
5990 5990
5991 GURL::Replacements replacements; 5991 GURL::Replacements replacements;
5992 std::string username("user2"); 5992 replacements.SetUsernameStr("user2");
5993 std::string password("secret"); 5993 replacements.SetPasswordStr("secret");
5994 replacements.SetUsernameStr(username);
5995 replacements.SetPasswordStr(password);
5996 GURL url_with_identity = url_requiring_auth.ReplaceComponents(replacements); 5994 GURL url_with_identity = url_requiring_auth.ReplaceComponents(replacements);
5997 5995
5998 scoped_ptr<URLRequest> r(context.CreateRequest( 5996 scoped_ptr<URLRequest> r(context.CreateRequest(
5999 url_with_identity, DEFAULT_PRIORITY, &d, NULL)); 5997 url_with_identity, DEFAULT_PRIORITY, &d, NULL));
6000 r->Start(); 5998 r->Start();
6001 5999
6002 base::RunLoop().Run(); 6000 base::RunLoop().Run();
6003 6001
6004 EXPECT_TRUE(d.data_received().find("user2/secret") != std::string::npos); 6002 EXPECT_TRUE(d.data_received().find("user2/secret") != std::string::npos);
6005 6003
(...skipping 2811 matching lines...) Expand 10 before | Expand all | Expand 10 after
8817 8815
8818 EXPECT_FALSE(r->is_pending()); 8816 EXPECT_FALSE(r->is_pending());
8819 EXPECT_EQ(1, d->response_started_count()); 8817 EXPECT_EQ(1, d->response_started_count());
8820 EXPECT_FALSE(d->received_data_before_response()); 8818 EXPECT_FALSE(d->received_data_before_response());
8821 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); 8819 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size));
8822 } 8820 }
8823 } 8821 }
8824 #endif // !defined(DISABLE_FTP_SUPPORT) 8822 #endif // !defined(DISABLE_FTP_SUPPORT)
8825 8823
8826 } // namespace net 8824 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_stream_factory_impl.cc ('k') | net/websockets/websocket_end_to_end_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698