diff options
| author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-29 06:15:44 +0000 |
|---|---|---|
| committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-29 06:15:44 +0000 |
| commit | 13c8a0903376ff406151679d8673a6452d721290 (patch) | |
| tree | dbb5b8e9503f8d0ee447863089f3e6f23692910f /net/url_request/url_request_unittest.cc | |
| parent | 6b55570f03236557b8b966b08dfbdda1ea91aadc (diff) | |
| download | chromium_src-13c8a0903376ff406151679d8673a6452d721290.zip chromium_src-13c8a0903376ff406151679d8673a6452d721290.tar.gz chromium_src-13c8a0903376ff406151679d8673a6452d721290.tar.bz2 | |
Net: Convert username and password to string16.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3040016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54101 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request/url_request_unittest.cc')
| -rw-r--r-- | net/url_request/url_request_unittest.cc | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc index 8c842fe..bfbd290 100644 --- a/net/url_request/url_request_unittest.cc +++ b/net/url_request/url_request_unittest.cc @@ -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 @@ using base::Time; 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 @@ TEST_F(URLRequestTestHTTP, BasicAuth) { // 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 @@ TEST_F(URLRequestTestHTTP, BasicAuth) { // 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 @@ TEST_F(URLRequestTestHTTP, BasicAuthWithCookies) { { 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 @@ class RestartTestJob : public URLRequestTestJob { this->NotifyRestartRequired(); } private: - ~RestartTestJob() {} + ~RestartTestJob() {} }; class CancelTestJob : public URLRequestTestJob { @@ -2335,8 +2339,8 @@ TEST_F(URLRequestTestFTP, FLAKY_FTPCheckWrongPasswordRestart) { 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 @@ TEST_F(URLRequestTestFTP, FLAKY_FTPCheckWrongUserRestart) { 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 @@ TEST_F(URLRequestTestFTP, FLAKY_FTPCacheLoginBoxCredentials) { 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"), |
