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

Unified Diff: net/url_request/url_request_unittest.cc

Issue 3040016: Net: Convert username and password to string16. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: address comments Created 10 years, 5 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
« no previous file with comments | « net/url_request/url_request_unittest.h ('k') | net/websockets/websocket_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_unittest.cc
===================================================================
--- net/url_request/url_request_unittest.cc (revision 53997)
+++ net/url_request/url_request_unittest.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -51,6 +51,10 @@
namespace {
+const string16 kChrome(ASCIIToUTF16("chrome"));
+const string16 kSecret(ASCIIToUTF16("secret"));
+const string16 kUser(ASCIIToUTF16("user"));
+
base::StringPiece TestNetResourceProvider(int key) {
return "header";
}
@@ -1165,8 +1169,8 @@
// populate the cache
{
TestDelegate d;
- d.set_username(L"user");
- d.set_password(L"secret");
+ d.set_username(kUser);
+ d.set_password(kSecret);
URLRequest r(server_->TestServerPage("auth-basic"), &d);
r.set_context(context);
@@ -1182,8 +1186,8 @@
// response should be fetched from the cache.
{
TestDelegate d;
- d.set_username(L"user");
- d.set_password(L"secret");
+ d.set_username(kUser);
+ d.set_password(kSecret);
URLRequest r(server_->TestServerPage("auth-basic"), &d);
r.set_context(context);
@@ -1212,8 +1216,8 @@
{
scoped_refptr<URLRequestContext> context = new TestURLRequestContext();
TestDelegate d;
- d.set_username(L"user");
- d.set_password(L"secret");
+ d.set_username(kUser);
+ d.set_password(kSecret);
URLRequest r(url_requiring_auth, &d);
r.set_context(context);
@@ -1771,7 +1775,7 @@
this->NotifyRestartRequired();
}
private:
- ~RestartTestJob() {}
+ ~RestartTestJob() {}
};
class CancelTestJob : public URLRequestTestJob {
@@ -2335,8 +2339,8 @@
TestDelegate d;
// Set correct login credentials. The delegate will be asked for them when
// the initial login with wrong credentials will fail.
- d.set_username(L"chrome");
- d.set_password(L"chrome");
+ d.set_username(kChrome);
+ d.set_password(kChrome);
{
TestURLRequest r(server_->TestServerPage("/LICENSE",
"chrome", "wrong_password"), &d);
@@ -2388,8 +2392,8 @@
TestDelegate d;
// Set correct login credentials. The delegate will be asked for them when
// the initial login with wrong credentials will fail.
- d.set_username(L"chrome");
- d.set_password(L"chrome");
+ d.set_username(kChrome);
+ d.set_password(kChrome);
{
TestURLRequest r(server_->TestServerPage("/LICENSE",
"wrong_user", "chrome"), &d);
@@ -2464,8 +2468,8 @@
scoped_ptr<TestDelegate> d(new TestDelegate);
// Set correct login credentials. The delegate will be asked for them when
// the initial login with wrong credentials will fail.
- d->set_username(L"chrome");
- d->set_password(L"chrome");
+ d->set_username(kChrome);
+ d->set_password(kChrome);
{
TestURLRequest r(server_->TestServerPage("/LICENSE",
"chrome", "wrong_password"),
« no previous file with comments | « net/url_request/url_request_unittest.h ('k') | net/websockets/websocket_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698