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

Unified Diff: net/socket_stream/socket_stream_unittest.cc

Issue 8340026: Use AuthCredentials throughout the network stack instead of username/password. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: mac compile fix Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: net/socket_stream/socket_stream_unittest.cc
diff --git a/net/socket_stream/socket_stream_unittest.cc b/net/socket_stream/socket_stream_unittest.cc
index cbdd6edf984410d2fded422fa75838ce3c1da4e6..37324984e8125faf4dc7ffda3afed43bae837630 100644
--- a/net/socket_stream/socket_stream_unittest.cc
+++ b/net/socket_stream/socket_stream_unittest.cc
@@ -144,14 +144,12 @@ class SocketStreamEventRecorder : public net::SocketStream::Delegate {
event->socket->Close();
}
void DoRestartWithAuth(SocketStreamEvent* event) {
- VLOG(1) << "RestartWithAuth username=" << username_
- << " password=" << password_;
- event->socket->RestartWithAuth(username_, password_);
+ VLOG(1) << "RestartWithAuth username=" << credentials_.username()
asanka 2011/10/27 20:01:20 DVLOG
cbentzel 2011/10/28 02:18:40 Not in this CL.
+ << " password=" << credentials_.password();
+ event->socket->RestartWithAuth(credentials_);
}
- void SetAuthInfo(const string16& username,
- const string16& password) {
- username_ = username;
- password_ = password;
+ void SetAuthInfo(const net::AuthCredentials& credentials) {
+ credentials_ = credentials;
}
void CompleteConnection(int result) {
connection_callback_->Run(result);
@@ -172,9 +170,7 @@ class SocketStreamEventRecorder : public net::SocketStream::Delegate {
base::Callback<void(SocketStreamEvent*)> on_error_;
net::OldCompletionCallback* callback_;
net::OldCompletionCallback* connection_callback_;
-
- string16 username_;
- string16 password_;
+ net::AuthCredentials credentials_;
DISALLOW_COPY_AND_ASSIGN(SocketStreamEventRecorder);
};
@@ -374,7 +370,8 @@ TEST_F(SocketStreamTest, BasicAuthProxy) {
new SocketStreamEventRecorder(&callback));
delegate->SetOnConnected(base::Bind(&SocketStreamEventRecorder::DoClose,
base::Unretained(delegate.get())));
- delegate->SetAuthInfo(ASCIIToUTF16("foo"), ASCIIToUTF16("bar"));
+ delegate->SetAuthInfo(net::AuthCredentials(ASCIIToUTF16("foo"),
+ ASCIIToUTF16("bar")));
delegate->SetOnAuthRequired(base::Bind(
&SocketStreamEventRecorder::DoRestartWithAuth,
base::Unretained(delegate.get())));

Powered by Google App Engine
This is Rietveld 408576698