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

Side by Side Diff: net/cookies/cookie_util_unittest.cc

Issue 2930893002: Change all "google.com" references in net/cookies to "foo.com" to avoid repeatedly tripping ov… (Closed)
Patch Set: Created 3 years, 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <string> 5 #include <string>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/strings/string_split.h" 8 #include "base/strings/string_split.h"
9 #include "net/cookies/cookie_util.h" 9 #include "net/cookies/cookie_util.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 28 matching lines...) Expand all
39 const std::string& str_expected) { 39 const std::string& str_expected) {
40 cookie_util::ParsedRequestCookies prc = MakeParsedRequestCookies(parsed); 40 cookie_util::ParsedRequestCookies prc = MakeParsedRequestCookies(parsed);
41 EXPECT_EQ(str_expected, cookie_util::SerializeRequestCookieLine(prc)); 41 EXPECT_EQ(str_expected, cookie_util::SerializeRequestCookieLine(prc));
42 } 42 }
43 43
44 TEST(CookieUtilTest, TestDomainIsHostOnly) { 44 TEST(CookieUtilTest, TestDomainIsHostOnly) {
45 const struct { 45 const struct {
46 const char* str; 46 const char* str;
47 const bool is_host_only; 47 const bool is_host_only;
48 } tests[] = { 48 } tests[] = {
49 { "", true }, 49 {"", true}, {"www.google.izzle", true}, {".google.izzle", false}};
50 { "www.google.com", true },
51 { ".google.com", false }
52 };
53 50
54 for (size_t i = 0; i < arraysize(tests); ++i) { 51 for (size_t i = 0; i < arraysize(tests); ++i) {
55 EXPECT_EQ(tests[i].is_host_only, 52 EXPECT_EQ(tests[i].is_host_only,
56 cookie_util::DomainIsHostOnly(tests[i].str)); 53 cookie_util::DomainIsHostOnly(tests[i].str));
57 } 54 }
58 } 55 }
59 56
60 TEST(CookieUtilTest, TestCookieDateParsing) { 57 TEST(CookieUtilTest, TestCookieDateParsing) {
61 const struct { 58 const struct {
62 const char* str; 59 const char* str;
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 cookie_util::GetEffectiveDomain("ws", "www.example.com")); 247 cookie_util::GetEffectiveDomain("ws", "www.example.com"));
251 EXPECT_EQ("example.com", 248 EXPECT_EQ("example.com",
252 cookie_util::GetEffectiveDomain("wss", "www.example.com")); 249 cookie_util::GetEffectiveDomain("wss", "www.example.com"));
253 EXPECT_EQ("www.example.com", 250 EXPECT_EQ("www.example.com",
254 cookie_util::GetEffectiveDomain("ftp", "www.example.com")); 251 cookie_util::GetEffectiveDomain("ftp", "www.example.com"));
255 } 252 }
256 253
257 } // namespace 254 } // namespace
258 255
259 } // namespace net 256 } // namespace net
OLDNEW
« net/cookies/cookie_store_unittest.h ('K') | « net/cookies/cookie_store_unittest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698