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

Side by Side Diff: net/http/http_auth_unittest.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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/http/http_auth_handler_digest.cc ('k') | net/http/http_cache.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <set> 5 #include <set>
6 #include <string> 6 #include <string>
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 std::string challenge_str = "Basic realm=\""; 297 std::string challenge_str = "Basic realm=\"";
298 HttpAuth::ChallengeTokenizer challenge(challenge_str.begin(), 298 HttpAuth::ChallengeTokenizer challenge(challenge_str.begin(),
299 challenge_str.end()); 299 challenge_str.end());
300 HttpUtil::NameValuePairsIterator parameters = challenge.param_pairs(); 300 HttpUtil::NameValuePairsIterator parameters = challenge.param_pairs();
301 301
302 EXPECT_TRUE(parameters.valid()); 302 EXPECT_TRUE(parameters.valid());
303 EXPECT_EQ(std::string("Basic"), challenge.scheme()); 303 EXPECT_EQ(std::string("Basic"), challenge.scheme());
304 EXPECT_TRUE(parameters.GetNext()); 304 EXPECT_TRUE(parameters.GetNext());
305 EXPECT_TRUE(parameters.valid()); 305 EXPECT_TRUE(parameters.valid());
306 EXPECT_EQ(std::string("realm"), parameters.name()); 306 EXPECT_EQ(std::string("realm"), parameters.name());
307 EXPECT_EQ(std::string(""), parameters.value()); 307 EXPECT_EQ(std::string(), parameters.value());
308 EXPECT_FALSE(parameters.GetNext()); 308 EXPECT_FALSE(parameters.GetNext());
309 } 309 }
310 310
311 // Use a name=value property with mismatching quote marks and spaces in the 311 // Use a name=value property with mismatching quote marks and spaces in the
312 // value. 312 // value.
313 TEST(HttpAuthTest, ChallengeTokenizerMismatchedQuotesSpaces) { 313 TEST(HttpAuthTest, ChallengeTokenizerMismatchedQuotesSpaces) {
314 std::string challenge_str = "Basic realm=\"foo bar"; 314 std::string challenge_str = "Basic realm=\"foo bar";
315 HttpAuth::ChallengeTokenizer challenge(challenge_str.begin(), 315 HttpAuth::ChallengeTokenizer challenge(challenge_str.begin(),
316 challenge_str.end()); 316 challenge_str.end());
317 HttpUtil::NameValuePairsIterator parameters = challenge.param_pairs(); 317 HttpUtil::NameValuePairsIterator parameters = challenge.param_pairs();
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 std::string name; 426 std::string name;
427 427
428 name = HttpAuth::GetAuthorizationHeaderName(HttpAuth::AUTH_SERVER); 428 name = HttpAuth::GetAuthorizationHeaderName(HttpAuth::AUTH_SERVER);
429 EXPECT_STREQ("Authorization", name.c_str()); 429 EXPECT_STREQ("Authorization", name.c_str());
430 430
431 name = HttpAuth::GetAuthorizationHeaderName(HttpAuth::AUTH_PROXY); 431 name = HttpAuth::GetAuthorizationHeaderName(HttpAuth::AUTH_PROXY);
432 EXPECT_STREQ("Proxy-Authorization", name.c_str()); 432 EXPECT_STREQ("Proxy-Authorization", name.c_str());
433 } 433 }
434 434
435 } // namespace net 435 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_auth_handler_digest.cc ('k') | net/http/http_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698