summaryrefslogtreecommitdiffstats
path: root/net/cookies
diff options
context:
space:
mode:
Diffstat (limited to 'net/cookies')
-rw-r--r--net/cookies/canonical_cookie_unittest.cc14
-rw-r--r--net/cookies/cookie_monster_unittest.cc87
-rw-r--r--net/cookies/cookie_store_test_helpers.cc2
-rw-r--r--net/cookies/cookie_store_unittest.h96
-rw-r--r--net/cookies/parsed_cookie.cc2
-rw-r--r--net/cookies/parsed_cookie_unittest.cc18
6 files changed, 77 insertions, 142 deletions
diff --git a/net/cookies/canonical_cookie_unittest.cc b/net/cookies/canonical_cookie_unittest.cc
index 161b27f..d7c25d188 100644
--- a/net/cookies/canonical_cookie_unittest.cc
+++ b/net/cookies/canonical_cookie_unittest.cc
@@ -55,16 +55,8 @@ TEST(CanonicalCookieTest, Constructor) {
EXPECT_EQ("/test", cookie.Path());
EXPECT_FALSE(cookie.IsSecure());
- CanonicalCookie cookie2(url,
- "A",
- "2",
- std::string(),
- std::string(),
- current_time,
- base::Time(),
- current_time,
- false,
- false);
+ CanonicalCookie cookie2(url, "A", "2", "", "", current_time, base::Time(),
+ current_time, false, false);
EXPECT_EQ(url.GetOrigin().spec(), cookie.Source());
EXPECT_EQ("A", cookie2.Name());
EXPECT_EQ("2", cookie2.Value());
@@ -295,7 +287,7 @@ TEST(CanonicalCookieTest, IsOnPath) {
EXPECT_TRUE(cookie->IsOnPath("/test/bar.html"));
// Test the empty string edge case.
- EXPECT_FALSE(cookie->IsOnPath(std::string()));
+ EXPECT_FALSE(cookie->IsOnPath(""));
cookie.reset(
CanonicalCookie::Create(GURL("http://www.example.com/test/foo.html"),
diff --git a/net/cookies/cookie_monster_unittest.cc b/net/cookies/cookie_monster_unittest.cc
index b3688c3..116d486 100644
--- a/net/cookies/cookie_monster_unittest.cc
+++ b/net/cookies/cookie_monster_unittest.cc
@@ -233,44 +233,20 @@ class CookieMonsterTest : public CookieStoreTest<CookieMonsterTestTraits> {
base::Time(), false, false));
// Host cookies
- EXPECT_TRUE(this->SetCookieWithDetails(cm,
- url_top_level_domain_plus_1,
- "host_1",
- "X",
- std::string(),
- "/",
- base::Time(),
- false,
- false));
- EXPECT_TRUE(this->SetCookieWithDetails(cm,
- url_top_level_domain_plus_2,
- "host_2",
- "X",
- std::string(),
- "/",
- base::Time(),
- false,
- false));
- EXPECT_TRUE(this->SetCookieWithDetails(cm,
- url_top_level_domain_plus_3,
- "host_3",
- "X",
- std::string(),
- "/",
- base::Time(),
- false,
- false));
+ EXPECT_TRUE(this->SetCookieWithDetails(cm, url_top_level_domain_plus_1,
+ "host_1", "X", "", "/",
+ base::Time(), false, false));
+ EXPECT_TRUE(this->SetCookieWithDetails(cm, url_top_level_domain_plus_2,
+ "host_2", "X", "", "/",
+ base::Time(), false, false));
+ EXPECT_TRUE(this->SetCookieWithDetails(cm, url_top_level_domain_plus_3,
+ "host_3", "X", "", "/",
+ base::Time(), false, false));
// Http_only cookie
- EXPECT_TRUE(this->SetCookieWithDetails(cm,
- url_top_level_domain_plus_2,
- "httpo_check",
- "X",
- std::string(),
- "/",
- base::Time(),
- false,
- true));
+ EXPECT_TRUE(this->SetCookieWithDetails(cm, url_top_level_domain_plus_2,
+ "httpo_check", "X", "", "/",
+ base::Time(), false, true));
// Secure cookies
EXPECT_TRUE(this->SetCookieWithDetails(cm,
@@ -278,14 +254,9 @@ class CookieMonsterTest : public CookieStoreTest<CookieMonsterTestTraits> {
"sec_dom", "X", ".math.harvard.edu",
"/", base::Time(), true, false));
EXPECT_TRUE(this->SetCookieWithDetails(cm,
- url_top_level_domain_plus_2_secure,
- "sec_host",
- "X",
- std::string(),
- "/",
- base::Time(),
- true,
- false));
+ url_top_level_domain_plus_2_secure,
+ "sec_host", "X", "", "/",
+ base::Time(), true, false));
// Domain path cookies
EXPECT_TRUE(this->SetCookieWithDetails(cm, url_top_level_domain_plus_2,
@@ -298,24 +269,14 @@ class CookieMonsterTest : public CookieStoreTest<CookieMonsterTestTraits> {
base::Time(), false, false));
// Host path cookies
- EXPECT_TRUE(this->SetCookieWithDetails(cm,
- url_top_level_domain_plus_2,
- "host_path_1",
- "X",
- std::string(),
- "/dir1",
- base::Time(),
- false,
- false));
- EXPECT_TRUE(this->SetCookieWithDetails(cm,
- url_top_level_domain_plus_2,
- "host_path_2",
- "X",
- std::string(),
- "/dir1/dir2",
- base::Time(),
- false,
- false));
+ EXPECT_TRUE(this->SetCookieWithDetails(cm, url_top_level_domain_plus_2,
+ "host_path_1", "X",
+ "", "/dir1",
+ base::Time(), false, false));
+ EXPECT_TRUE(this->SetCookieWithDetails(cm, url_top_level_domain_plus_2,
+ "host_path_2", "X",
+ "", "/dir1/dir2",
+ base::Time(), false, false));
EXPECT_EQ(13U, this->GetAllCookies(cm).size());
}
@@ -2244,7 +2205,7 @@ TEST_F(CookieMonsterTest, PersisentCookieStorageTest) {
EXPECT_EQ(CookieStoreCommand::ADD, store->commands()[0].type);
// Remove it.
EXPECT_TRUE(SetCookie(cm, url_google_,"A=B; max-age=0"));
- this->MatchCookieLines(std::string(), GetCookies(cm, url_google_));
+ this->MatchCookieLines("", GetCookies(cm, url_google_));
ASSERT_EQ(2u, store->commands().size());
EXPECT_EQ(CookieStoreCommand::REMOVE, store->commands()[1].type);
diff --git a/net/cookies/cookie_store_test_helpers.cc b/net/cookies/cookie_store_test_helpers.cc
index 6ae4357d..e499538 100644
--- a/net/cookies/cookie_store_test_helpers.cc
+++ b/net/cookies/cookie_store_test_helpers.cc
@@ -90,7 +90,7 @@ std::string DelayedCookieMonster::GetCookiesWithOptions(
const GURL& url,
const CookieOptions& options) {
ADD_FAILURE();
- return std::string();
+ return "";
}
void DelayedCookieMonster::DeleteCookie(const GURL& url,
diff --git a/net/cookies/cookie_store_unittest.h b/net/cookies/cookie_store_unittest.h
index 0d2d7ed..134a193 100644
--- a/net/cookies/cookie_store_unittest.h
+++ b/net/cookies/cookie_store_unittest.h
@@ -275,10 +275,9 @@ TYPED_TEST_P(CookieStoreTest, DomainTest) {
// Test domain enforcement, should fail on a sub-domain or something too deep.
EXPECT_FALSE(this->SetCookie(cs, this->url_google_, "I=J; domain=.izzle"));
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, GURL("http://a.izzle")));
- EXPECT_FALSE(this->SetCookie(
- cs, this->url_google_, "K=L; domain=.bla.www.google.izzle"));
+ this->MatchCookieLines("", this->GetCookies(cs, GURL("http://a.izzle")));
+ EXPECT_FALSE(this->SetCookie(cs, this->url_google_,
+ "K=L; domain=.bla.www.google.izzle"));
this->MatchCookieLines("C=D; E=F; G=H",
this->GetCookies(cs, GURL("http://bla.www.google.izzle")));
this->MatchCookieLines("A=B; C=D; E=F; G=H",
@@ -293,8 +292,7 @@ TYPED_TEST_P(CookieStoreTest, DomainWithTrailingDotTest) {
"a=1; domain=.www.google.com."));
EXPECT_FALSE(this->SetCookie(cs, this->url_google_,
"b=2; domain=.www.google.com.."));
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
}
// Test that cookies can bet set on higher level domains.
@@ -368,7 +366,7 @@ TYPED_TEST_P(CookieStoreTest, InvalidDomainTest) {
EXPECT_FALSE(this->SetCookie(cs, url_foobar,
"o=15; domain=.foo.bar.com#sup"));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, url_foobar));
+ this->MatchCookieLines("", this->GetCookies(cs, url_foobar));
}
{
@@ -379,7 +377,7 @@ TYPED_TEST_P(CookieStoreTest, InvalidDomainTest) {
GURL url_foocom("http://foo.com.com");
EXPECT_FALSE(this->SetCookie(cs, url_foocom,
"a=1; domain=.foo.com.com.com"));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, url_foocom));
+ this->MatchCookieLines("", this->GetCookies(cs, url_foocom));
}
}
@@ -404,8 +402,8 @@ TYPED_TEST_P(CookieStoreTest, DomainWithoutLeadingDotTest) {
this->MatchCookieLines("a=1", this->GetCookies(cs, url));
this->MatchCookieLines("a=1",
this->GetCookies(cs, GURL("http://sub.www.google.com")));
- this->MatchCookieLines(
- std::string(), this->GetCookies(cs, GURL("http://something-else.com")));
+ this->MatchCookieLines("",
+ this->GetCookies(cs, GURL("http://something-else.com")));
}
}
@@ -431,11 +429,11 @@ TYPED_TEST_P(CookieStoreTest, TestIpAddress) {
scoped_refptr<CookieStore> cs(this->GetCookieStore());
EXPECT_FALSE(this->SetCookie(cs, url_ip, "b=2; domain=.1.2.3.4"));
EXPECT_FALSE(this->SetCookie(cs, url_ip, "c=3; domain=.3.4"));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, url_ip));
+ this->MatchCookieLines("", this->GetCookies(cs, url_ip));
// It should be allowed to set a cookie if domain= matches the IP address
// exactly. This matches IE/Firefox, even though it seems a bit wrong.
EXPECT_FALSE(this->SetCookie(cs, url_ip, "b=2; domain=1.2.3.3"));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, url_ip));
+ this->MatchCookieLines("", this->GetCookies(cs, url_ip));
EXPECT_TRUE(this->SetCookie(cs, url_ip, "b=2; domain=1.2.3.4"));
this->MatchCookieLines("b=2", this->GetCookies(cs, url_ip));
}
@@ -453,12 +451,10 @@ TYPED_TEST_P(CookieStoreTest, TestNonDottedAndTLD) {
this->MatchCookieLines("a=1", this->GetCookies(cs, url));
// Make sure it doesn't show up for a normal .com, it should be a host
// not a domain cookie.
- this->MatchCookieLines(
- std::string(),
+ this->MatchCookieLines("",
this->GetCookies(cs, GURL("http://hopefully-no-cookies.com/")));
if (TypeParam::supports_non_dotted_domains) {
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, GURL("http://.com/")));
+ this->MatchCookieLines("", this->GetCookies(cs, GURL("http://.com/")));
}
}
@@ -469,8 +465,7 @@ TYPED_TEST_P(CookieStoreTest, TestNonDottedAndTLD) {
if (TypeParam::supports_trailing_dots) {
EXPECT_TRUE(this->SetCookie(cs, url, "a=1"));
this->MatchCookieLines("a=1", this->GetCookies(cs, url));
- this->MatchCookieLines(
- std::string(),
+ this->MatchCookieLines("",
this->GetCookies(cs, GURL("http://hopefully-no-cookies.com./")));
} else {
EXPECT_FALSE(this->SetCookie(cs, url, "a=1"));
@@ -482,7 +477,7 @@ TYPED_TEST_P(CookieStoreTest, TestNonDottedAndTLD) {
GURL url("http://a.b");
EXPECT_FALSE(this->SetCookie(cs, url, "a=1; domain=.b"));
EXPECT_FALSE(this->SetCookie(cs, url, "b=2; domain=b"));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, url));
+ this->MatchCookieLines("", this->GetCookies(cs, url));
}
{ // Same test as above, but explicitly on a known TLD (com).
@@ -490,7 +485,7 @@ TYPED_TEST_P(CookieStoreTest, TestNonDottedAndTLD) {
GURL url("http://google.com");
EXPECT_FALSE(this->SetCookie(cs, url, "a=1; domain=.com"));
EXPECT_FALSE(this->SetCookie(cs, url, "b=2; domain=com"));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, url));
+ this->MatchCookieLines("", this->GetCookies(cs, url));
}
{ // Make sure can't set cookie on TLD which is dotted.
@@ -498,12 +493,11 @@ TYPED_TEST_P(CookieStoreTest, TestNonDottedAndTLD) {
GURL url("http://google.co.uk");
EXPECT_FALSE(this->SetCookie(cs, url, "a=1; domain=.co.uk"));
EXPECT_FALSE(this->SetCookie(cs, url, "b=2; domain=.uk"));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, url));
- this->MatchCookieLines(
- std::string(),
+ this->MatchCookieLines("", this->GetCookies(cs, url));
+ this->MatchCookieLines("",
this->GetCookies(cs, GURL("http://something-else.co.uk")));
- this->MatchCookieLines(
- std::string(), this->GetCookies(cs, GURL("http://something-else.uk")));
+ this->MatchCookieLines("",
+ this->GetCookies(cs, GURL("http://something-else.uk")));
}
{ // Intranet URLs should only be able to set host cookies.
@@ -539,11 +533,9 @@ TYPED_TEST_P(CookieStoreTest, TestHostEndsWithDot) {
}
// Make sure there weren't any side effects.
- this->MatchCookieLines(
- std::string(),
+ this->MatchCookieLines("",
this->GetCookies(cs, GURL("http://hopefully-no-cookies.com/")));
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, GURL("http://.com/")));
+ this->MatchCookieLines("", this->GetCookies(cs, GURL("http://.com/")));
}
TYPED_TEST_P(CookieStoreTest, InvalidScheme) {
@@ -560,7 +552,7 @@ TYPED_TEST_P(CookieStoreTest, InvalidScheme_Read) {
scoped_refptr<CookieStore> cs(this->GetCookieStore());
EXPECT_TRUE(this->SetCookie(cs, GURL(kUrlGoogle), kValidDomainCookieLine));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, GURL(kUrlFtp)));
+ this->MatchCookieLines("", this->GetCookies(cs, GURL(kUrlFtp)));
}
TYPED_TEST_P(CookieStoreTest, PathTest) {
@@ -573,9 +565,8 @@ TYPED_TEST_P(CookieStoreTest, PathTest) {
this->MatchCookieLines("A=B",
this->GetCookies(cs, GURL(url + "/wee/war/more/more")));
if (!TypeParam::has_path_prefix_bug)
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, GURL(url + "/weehee")));
- this->MatchCookieLines(std::string(), this->GetCookies(cs, GURL(url + "/")));
+ this->MatchCookieLines("", this->GetCookies(cs, GURL(url + "/weehee")));
+ this->MatchCookieLines("", this->GetCookies(cs, GURL(url + "/")));
// If we add a 0 length path, it should default to /
EXPECT_TRUE(this->SetCookie(cs, GURL(url), "A=C; path="));
@@ -621,17 +612,15 @@ TYPED_TEST_P(CookieStoreTest, HttpOnlyTest) {
options));
// Check httponly read protection.
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
- this->MatchCookieLines(
- "A=B", this->GetCookiesWithOptions(cs, this->url_google_, options));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("A=B",
+ this->GetCookiesWithOptions(cs, this->url_google_, options));
// Check httponly overwrite protection.
EXPECT_FALSE(this->SetCookie(cs, this->url_google_, "A=C"));
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
- this->MatchCookieLines(
- "A=B", this->GetCookiesWithOptions(cs, this->url_google_, options));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("A=B",
+ this->GetCookiesWithOptions(cs, this->url_google_, options));
EXPECT_TRUE(this->SetCookieWithOptions(cs, this->url_google_, "A=C",
options));
this->MatchCookieLines("A=C", this->GetCookies(cs, this->url_google_));
@@ -656,7 +645,7 @@ TYPED_TEST_P(CookieStoreTest, TestCookieDeletion) {
// Delete it via Max-Age.
EXPECT_TRUE(this->SetCookie(cs, this->url_google_,
std::string(kValidCookieLine) + "; max-age=0"));
- this->MatchCookieLineWithTimeout(cs, this->url_google_, std::string());
+ this->MatchCookieLineWithTimeout(cs, this->url_google_, "");
// Create a session cookie.
EXPECT_TRUE(this->SetCookie(cs, this->url_google_, kValidCookieLine));
@@ -665,8 +654,7 @@ TYPED_TEST_P(CookieStoreTest, TestCookieDeletion) {
EXPECT_TRUE(this->SetCookie(cs, this->url_google_,
std::string(kValidCookieLine) +
"; expires=Mon, 18-Apr-1977 22:50:13 GMT"));
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
// Create a persistent cookie.
EXPECT_TRUE(this->SetCookie(cs, this->url_google_,
@@ -677,7 +665,7 @@ TYPED_TEST_P(CookieStoreTest, TestCookieDeletion) {
// Delete it via Max-Age.
EXPECT_TRUE(this->SetCookie(cs, this->url_google_,
std::string(kValidCookieLine) + "; max-age=0"));
- this->MatchCookieLineWithTimeout(cs, this->url_google_, std::string());
+ this->MatchCookieLineWithTimeout(cs, this->url_google_, "");
// Create a persistent cookie.
EXPECT_TRUE(this->SetCookie(cs, this->url_google_,
@@ -688,8 +676,7 @@ TYPED_TEST_P(CookieStoreTest, TestCookieDeletion) {
EXPECT_TRUE(this->SetCookie(cs, this->url_google_,
std::string(kValidCookieLine) +
"; expires=Mon, 18-Apr-1977 22:50:13 GMT"));
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
// Create a persistent cookie.
EXPECT_TRUE(this->SetCookie(cs, this->url_google_,
@@ -716,8 +703,7 @@ TYPED_TEST_P(CookieStoreTest, TestCookieDeletion) {
EXPECT_TRUE(this->SetCookie(cs, this->url_google_,
std::string(kValidCookieLine) +
"; expires=Thu, 1-Jan-1970 00:00:00 GMT"));
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
}
TYPED_TEST_P(CookieStoreTest, TestDeleteAllCreatedBetween) {
@@ -745,8 +731,7 @@ TYPED_TEST_P(CookieStoreTest, TestDeleteAllCreatedBetween) {
// Remove the cookie with an interval defined by two dates.
EXPECT_EQ(1, this->DeleteCreatedBetween(cs, last_minute, next_minute));
// Check that the cookie disappeared.
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
// Add another cookie.
EXPECT_TRUE(this->SetCookie(cs, this->url_google_, "C=D"));
@@ -756,8 +741,7 @@ TYPED_TEST_P(CookieStoreTest, TestDeleteAllCreatedBetween) {
// Remove the cookie with a null ending time.
EXPECT_EQ(1, this->DeleteCreatedBetween(cs, last_minute, base::Time()));
// Check that the cookie disappeared.
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
}
TYPED_TEST_P(CookieStoreTest, TestSecure) {
@@ -769,13 +753,11 @@ TYPED_TEST_P(CookieStoreTest, TestSecure) {
EXPECT_TRUE(this->SetCookie(cs, this->url_google_secure_, "A=B; secure"));
// The secure should overwrite the non-secure.
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
this->MatchCookieLines("A=B", this->GetCookies(cs, this->url_google_secure_));
EXPECT_TRUE(this->SetCookie(cs, this->url_google_secure_, "D=E; secure"));
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->url_google_));
+ this->MatchCookieLines("", this->GetCookies(cs, this->url_google_));
this->MatchCookieLines("A=B; D=E",
this->GetCookies(cs, this->url_google_secure_));
diff --git a/net/cookies/parsed_cookie.cc b/net/cookies/parsed_cookie.cc
index ecb8712..5cd542d 100644
--- a/net/cookies/parsed_cookie.cc
+++ b/net/cookies/parsed_cookie.cc
@@ -424,7 +424,7 @@ bool ParsedCookie::SetBool(size_t* index,
ClearAttributePair(*index);
return true;
} else {
- return SetAttributePair(index, key, std::string());
+ return SetAttributePair(index, key, "");
}
}
diff --git a/net/cookies/parsed_cookie_unittest.cc b/net/cookies/parsed_cookie_unittest.cc
index 57de115..3729650 100644
--- a/net/cookies/parsed_cookie_unittest.cc
+++ b/net/cookies/parsed_cookie_unittest.cc
@@ -208,7 +208,7 @@ TEST(ParsedCookieTest, InvalidTooLong) {
}
TEST(ParsedCookieTest, InvalidEmpty) {
- ParsedCookie pc((std::string()));
+ ParsedCookie pc("");
EXPECT_FALSE(pc.IsValid());
}
@@ -259,7 +259,7 @@ TEST(ParsedCookieTest, SerializeCookieLine) {
TEST(ParsedCookieTest, SetNameAndValue) {
- ParsedCookie empty((std::string()));
+ ParsedCookie empty("");
EXPECT_FALSE(empty.IsValid());
EXPECT_FALSE(empty.SetDomain("foobar.com"));
EXPECT_TRUE(empty.SetName("name"));
@@ -282,7 +282,7 @@ TEST(ParsedCookieTest, SetNameAndValue) {
EXPECT_EQ("name=value", pc.ToCookieLine());
EXPECT_TRUE(pc.IsValid());
- EXPECT_FALSE(pc.SetName(std::string()));
+ EXPECT_FALSE(pc.SetName(""));
EXPECT_EQ("name=value", pc.ToCookieLine());
EXPECT_TRUE(pc.IsValid());
@@ -303,7 +303,7 @@ TEST(ParsedCookieTest, SetNameAndValue) {
EXPECT_EQ("test=\"foobar\"", pc.ToCookieLine());
EXPECT_TRUE(pc.IsValid());
- EXPECT_TRUE(pc.SetValue(std::string()));
+ EXPECT_TRUE(pc.SetValue(""));
EXPECT_EQ("test=", pc.ToCookieLine());
EXPECT_TRUE(pc.IsValid());
}
@@ -313,7 +313,7 @@ TEST(ParsedCookieTest, SetAttributes) {
EXPECT_TRUE(pc.IsValid());
// Clear an unset attribute.
- EXPECT_TRUE(pc.SetDomain(std::string()));
+ EXPECT_TRUE(pc.SetDomain(""));
EXPECT_FALSE(pc.HasDomain());
EXPECT_EQ("name=value", pc.ToCookieLine());
EXPECT_TRUE(pc.IsValid());
@@ -355,10 +355,10 @@ TEST(ParsedCookieTest, SetAttributes) {
pc.ToCookieLine());
// Clear the rest and change the name and value.
- EXPECT_TRUE(pc.SetDomain(std::string()));
- EXPECT_TRUE(pc.SetPath(std::string()));
- EXPECT_TRUE(pc.SetExpires(std::string()));
- EXPECT_TRUE(pc.SetMaxAge(std::string()));
+ EXPECT_TRUE(pc.SetDomain(""));
+ EXPECT_TRUE(pc.SetPath(""));
+ EXPECT_TRUE(pc.SetExpires(""));
+ EXPECT_TRUE(pc.SetMaxAge(""));
EXPECT_TRUE(pc.SetIsSecure(false));
EXPECT_TRUE(pc.SetIsHttpOnly(false));
EXPECT_TRUE(pc.SetName("name2"));