diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-05-15 10:20:33 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-05-15 10:28:57 +0000 |
commit | d17ea114e5ef69ad5d5d7413280a13e6428098aa (patch) | |
tree | 2c01a75df69f30d27b1432467cfe7c1467a498da /chromium/net/cookies/parsed_cookie_unittest.cc | |
parent | 8c5c43c7b138c9b4b0bf56d946e61d3bbc111bec (diff) | |
download | qtwebengine-chromium-d17ea114e5ef69ad5d5d7413280a13e6428098aa.tar.gz |
BASELINE: Update Chromium to 67.0.3396.47
Change-Id: Idcb1341782e417561a2473eeecc82642dafda5b7
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'chromium/net/cookies/parsed_cookie_unittest.cc')
-rw-r--r-- | chromium/net/cookies/parsed_cookie_unittest.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/chromium/net/cookies/parsed_cookie_unittest.cc b/chromium/net/cookies/parsed_cookie_unittest.cc index e1e3f9beca7..fc7d206a340 100644 --- a/chromium/net/cookies/parsed_cookie_unittest.cc +++ b/chromium/net/cookies/parsed_cookie_unittest.cc @@ -467,7 +467,7 @@ TEST(ParsedCookieTest, SetSameSite) { EXPECT_EQ("name=value", pc.ToCookieLine()); EXPECT_EQ(CookieSameSite::DEFAULT_MODE, pc.SameSite()); - // Test each priority, expect case-insensitive compare. + // Test each samesite directive, expect case-insensitive compare. EXPECT_TRUE(pc.SetSameSite("strict")); EXPECT_EQ("name=value; samesite=strict", pc.ToCookieLine()); EXPECT_EQ(CookieSameSite::STRICT_MODE, pc.SameSite()); @@ -483,24 +483,28 @@ TEST(ParsedCookieTest, SetSameSite) { EXPECT_EQ(CookieSameSite::LAX_MODE, pc.SameSite()); EXPECT_TRUE(pc.IsValid()); + // Remove the SameSite attribute. EXPECT_TRUE(pc.SetSameSite("")); EXPECT_EQ("name=value", pc.ToCookieLine()); EXPECT_EQ(CookieSameSite::DEFAULT_MODE, pc.SameSite()); EXPECT_TRUE(pc.IsValid()); EXPECT_TRUE(pc.SetSameSite("Blah")); - EXPECT_FALSE(pc.IsValid()); + EXPECT_EQ("name=value; samesite=Blah", pc.ToCookieLine()); + EXPECT_EQ(CookieSameSite::NO_RESTRICTION, pc.SameSite()); + EXPECT_TRUE(pc.IsValid()); } -TEST(ParsedCookieTest, InvalidSameSiteValue) { +TEST(ParsedCookieTest, SameSiteValues) { struct TestCase { const char* cookie; bool valid; CookieSameSite mode; } cases[]{{"n=v; samesite=strict", true, CookieSameSite::STRICT_MODE}, {"n=v; samesite=lax", true, CookieSameSite::LAX_MODE}, - {"n=v; samesite=boo", false, CookieSameSite::DEFAULT_MODE}, - {"n=v; samesite", false, CookieSameSite::DEFAULT_MODE}}; + {"n=v; samesite=boo", true, CookieSameSite::NO_RESTRICTION}, + {"n=v; samesite", true, CookieSameSite::NO_RESTRICTION}, + {"n=v", true, CookieSameSite::DEFAULT_MODE}}; for (const auto& test : cases) { SCOPED_TRACE(test.cookie); |