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

Unified Diff: net/base/static_cookie_policy_unittest.cc

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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/base/static_cookie_policy.cc ('k') | net/base/sys_addrinfo.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/static_cookie_policy_unittest.cc
diff --git a/net/base/static_cookie_policy_unittest.cc b/net/base/static_cookie_policy_unittest.cc
deleted file mode 100644
index 7749411addf00669fddcaad3a7c81c4dacd0b434..0000000000000000000000000000000000000000
--- a/net/base/static_cookie_policy_unittest.cc
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright (c) 2011 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.
-
-#include "net/base/net_errors.h"
-#include "net/base/static_cookie_policy.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "url/gurl.h"
-
-namespace net {
-
-class StaticCookiePolicyTest : public testing::Test {
- public:
- StaticCookiePolicyTest()
- : url_google_("http://www.google.izzle"),
- url_google_secure_("https://www.google.izzle"),
- url_google_mail_("http://mail.google.izzle"),
- url_google_analytics_("http://www.googleanalytics.izzle") {
- }
- void SetPolicyType(StaticCookiePolicy::Type type) {
- policy_.set_type(type);
- }
- int CanGetCookies(const GURL& url, const GURL& first_party) {
- return policy_.CanGetCookies(url, first_party);
- }
- int CanSetCookie(const GURL& url, const GURL& first_party) {
- return policy_.CanSetCookie(url, first_party);
- }
- protected:
- StaticCookiePolicy policy_;
- GURL url_google_;
- GURL url_google_secure_;
- GURL url_google_mail_;
- GURL url_google_analytics_;
-};
-
-TEST_F(StaticCookiePolicyTest, DefaultPolicyTest) {
- EXPECT_EQ(OK, CanGetCookies(url_google_, url_google_));
- EXPECT_EQ(OK, CanGetCookies(url_google_, url_google_secure_));
- EXPECT_EQ(OK, CanGetCookies(url_google_, url_google_mail_));
- EXPECT_EQ(OK, CanGetCookies(url_google_, url_google_analytics_));
- EXPECT_EQ(OK, CanGetCookies(url_google_, GURL()));
-
- EXPECT_EQ(OK, CanSetCookie(url_google_, url_google_));
- EXPECT_EQ(OK, CanSetCookie(url_google_, url_google_secure_));
- EXPECT_EQ(OK, CanSetCookie(url_google_, url_google_mail_));
- EXPECT_EQ(OK, CanSetCookie(url_google_, url_google_analytics_));
- EXPECT_EQ(OK, CanSetCookie(url_google_, GURL()));
-}
-
-TEST_F(StaticCookiePolicyTest, AllowAllCookiesTest) {
- SetPolicyType(StaticCookiePolicy::ALLOW_ALL_COOKIES);
-
- EXPECT_EQ(OK, CanGetCookies(url_google_, url_google_));
- EXPECT_EQ(OK, CanGetCookies(url_google_, url_google_secure_));
- EXPECT_EQ(OK, CanGetCookies(url_google_, url_google_mail_));
- EXPECT_EQ(OK, CanGetCookies(url_google_, url_google_analytics_));
- EXPECT_EQ(OK, CanGetCookies(url_google_, GURL()));
-
- EXPECT_EQ(OK, CanSetCookie(url_google_, url_google_));
- EXPECT_EQ(OK, CanSetCookie(url_google_, url_google_secure_));
- EXPECT_EQ(OK, CanSetCookie(url_google_, url_google_mail_));
- EXPECT_EQ(OK, CanSetCookie(url_google_, url_google_analytics_));
- EXPECT_EQ(OK, CanSetCookie(url_google_, GURL()));
-}
-
-TEST_F(StaticCookiePolicyTest, BlockAllThirdPartyCookiesTest) {
- SetPolicyType(StaticCookiePolicy::BLOCK_ALL_THIRD_PARTY_COOKIES);
-
- EXPECT_EQ(OK, CanGetCookies(url_google_, url_google_));
- EXPECT_EQ(OK, CanGetCookies(url_google_, url_google_secure_));
- EXPECT_EQ(OK, CanGetCookies(url_google_, url_google_mail_));
- EXPECT_NE(OK, CanGetCookies(url_google_, url_google_analytics_));
- EXPECT_EQ(OK, CanGetCookies(url_google_, GURL()));
-
- EXPECT_EQ(OK, CanSetCookie(url_google_, url_google_));
- EXPECT_EQ(OK, CanSetCookie(url_google_, url_google_secure_));
- EXPECT_EQ(OK, CanSetCookie(url_google_, url_google_mail_));
- EXPECT_NE(OK, CanSetCookie(url_google_, url_google_analytics_));
- EXPECT_EQ(OK, CanSetCookie(url_google_, GURL()));
-}
-
-TEST_F(StaticCookiePolicyTest, BlockAllCookiesTest) {
- SetPolicyType(StaticCookiePolicy::BLOCK_ALL_COOKIES);
-
- EXPECT_NE(OK, CanGetCookies(url_google_, url_google_));
- EXPECT_NE(OK, CanGetCookies(url_google_, url_google_secure_));
- EXPECT_NE(OK, CanGetCookies(url_google_, url_google_mail_));
- EXPECT_NE(OK, CanGetCookies(url_google_, url_google_analytics_));
- EXPECT_NE(OK, CanGetCookies(url_google_, GURL()));
-
- EXPECT_NE(OK, CanSetCookie(url_google_, url_google_));
- EXPECT_NE(OK, CanSetCookie(url_google_, url_google_secure_));
- EXPECT_NE(OK, CanSetCookie(url_google_, url_google_mail_));
- EXPECT_NE(OK, CanSetCookie(url_google_, url_google_analytics_));
- EXPECT_NE(OK, CanSetCookie(url_google_, GURL()));
-}
-
-} // namespace net
« no previous file with comments | « net/base/static_cookie_policy.cc ('k') | net/base/sys_addrinfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698