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

Unified Diff: net/cookies/canonical_cookie_unittest.cc

Issue 14113014: Adding Priority field to cookies. (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renamed enums PRIORITY_* to COOKIE_PRIORITY_*. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cookies/canonical_cookie.cc ('k') | net/cookies/cookie_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cookies/canonical_cookie_unittest.cc
diff --git a/net/cookies/canonical_cookie_unittest.cc b/net/cookies/canonical_cookie_unittest.cc
index 161b27f3db669cceffd0f687ca36d38302d7fdc7..a9eda3105bc655c9b2faa0b5397831975e633ff6 100644
--- a/net/cookies/canonical_cookie_unittest.cc
+++ b/net/cookies/canonical_cookie_unittest.cc
@@ -6,6 +6,7 @@
#include "base/memory/scoped_ptr.h"
#include "googleurl/src/gurl.h"
+#include "net/cookies/cookie_constants.h"
#include "net/cookies/cookie_options.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -46,8 +47,8 @@ TEST(CanonicalCookieTest, Constructor) {
base::Time current_time = base::Time::Now();
CanonicalCookie cookie(url, "A", "2", "www.example.com", "/test",
- current_time, base::Time(), current_time, false,
- false);
+ current_time, base::Time(), current_time, false, false,
+ COOKIE_PRIORITY_DEFAULT);
EXPECT_EQ(url.GetOrigin().spec(), cookie.Source());
EXPECT_EQ("A", cookie.Name());
EXPECT_EQ("2", cookie.Value());
@@ -64,7 +65,8 @@ TEST(CanonicalCookieTest, Constructor) {
base::Time(),
current_time,
false,
- false);
+ false,
+ COOKIE_PRIORITY_DEFAULT);
EXPECT_EQ(url.GetOrigin().spec(), cookie.Source());
EXPECT_EQ("A", cookie2.Name());
EXPECT_EQ("2", cookie2.Value());
@@ -120,7 +122,7 @@ TEST(CanonicalCookieTest, Create) {
// string.
cookie.reset(CanonicalCookie::Create(
url, "A", "2", "www.example.com", "/test", creation_time, base::Time(),
- false, false));
+ false, false, COOKIE_PRIORITY_DEFAULT));
EXPECT_EQ(url.GetOrigin().spec(), cookie->Source());
EXPECT_EQ("A", cookie->Name());
EXPECT_EQ("2", cookie->Value());
@@ -130,7 +132,7 @@ TEST(CanonicalCookieTest, Create) {
cookie.reset(CanonicalCookie::Create(
url, "A", "2", ".www.example.com", "/test", creation_time, base::Time(),
- false, false));
+ false, false, COOKIE_PRIORITY_DEFAULT));
EXPECT_EQ(url.GetOrigin().spec(), cookie->Source());
EXPECT_EQ("A", cookie->Name());
EXPECT_EQ("2", cookie->Value());
@@ -188,14 +190,16 @@ TEST(CanonicalCookieTest, IsEquivalent) {
scoped_ptr<CanonicalCookie> cookie(
new CanonicalCookie(url, cookie_name, cookie_value, cookie_domain,
cookie_path, creation_time, expiration_time,
- last_access_time, secure, httponly));
+ last_access_time, secure, httponly,
+ COOKIE_PRIORITY_MEDIUM));
EXPECT_TRUE(cookie->IsEquivalent(*cookie));
// Test that two identical cookies are equivalent.
scoped_ptr<CanonicalCookie> other_cookie(
new CanonicalCookie(url, cookie_name, cookie_value, cookie_domain,
cookie_path, creation_time, expiration_time,
- last_access_time, secure, httponly));
+ last_access_time, secure, httponly,
+ COOKIE_PRIORITY_MEDIUM));
EXPECT_TRUE(cookie->IsEquivalent(*other_cookie));
// Tests that use different variations of attribute values that
@@ -203,7 +207,8 @@ TEST(CanonicalCookieTest, IsEquivalent) {
other_cookie.reset(new CanonicalCookie(url, cookie_name, "2", cookie_domain,
cookie_path, creation_time,
expiration_time, last_access_time,
- secure, httponly));
+ secure, httponly,
+ COOKIE_PRIORITY_HIGH));
EXPECT_TRUE(cookie->IsEquivalent(*other_cookie));
base::Time other_creation_time =
@@ -211,13 +216,15 @@ TEST(CanonicalCookieTest, IsEquivalent) {
other_cookie.reset(new CanonicalCookie(url, cookie_name, "2", cookie_domain,
cookie_path, other_creation_time,
expiration_time, last_access_time,
- secure, httponly));
+ secure, httponly,
+ COOKIE_PRIORITY_MEDIUM));
EXPECT_TRUE(cookie->IsEquivalent(*other_cookie));
other_cookie.reset(new CanonicalCookie(url, cookie_name, cookie_name,
cookie_domain, cookie_path,
creation_time, expiration_time,
- last_access_time, true, httponly));
+ last_access_time, true, httponly,
+ COOKIE_PRIORITY_LOW));
EXPECT_TRUE(cookie->IsEquivalent(*other_cookie));
// Tests that use different variations of attribute values that
@@ -225,13 +232,15 @@ TEST(CanonicalCookieTest, IsEquivalent) {
other_cookie.reset(new CanonicalCookie(url, "B", cookie_value, cookie_domain,
cookie_path, creation_time,
expiration_time, last_access_time,
- secure, httponly));
+ secure, httponly,
+ COOKIE_PRIORITY_MEDIUM));
EXPECT_FALSE(cookie->IsEquivalent(*other_cookie));
other_cookie.reset(new CanonicalCookie(url, cookie_name, cookie_value,
"www.example.com", cookie_path,
creation_time, expiration_time,
- last_access_time, secure, httponly));
+ last_access_time, secure, httponly,
+ COOKIE_PRIORITY_MEDIUM));
EXPECT_TRUE(cookie->IsDomainCookie());
EXPECT_FALSE(other_cookie->IsDomainCookie());
EXPECT_FALSE(cookie->IsEquivalent(*other_cookie));
@@ -239,13 +248,15 @@ TEST(CanonicalCookieTest, IsEquivalent) {
other_cookie.reset(new CanonicalCookie(url, cookie_name, cookie_value,
".example.com", cookie_path,
creation_time, expiration_time,
- last_access_time, secure, httponly));
+ last_access_time, secure, httponly,
+ COOKIE_PRIORITY_MEDIUM));
EXPECT_FALSE(cookie->IsEquivalent(*other_cookie));
other_cookie.reset(new CanonicalCookie(url, cookie_name, cookie_value,
cookie_domain, "/test/0",
creation_time, expiration_time,
- last_access_time, secure, httponly));
+ last_access_time, secure, httponly,
+ COOKIE_PRIORITY_MEDIUM));
EXPECT_FALSE(cookie->IsEquivalent(*other_cookie));
}
« no previous file with comments | « net/cookies/canonical_cookie.cc ('k') | net/cookies/cookie_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698