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

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: Final pass through to pick up some missed google references. 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
« no previous file with comments | « net/cookies/cookie_store_unittest.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 27 matching lines...) Expand all
38 void CheckSerialize(const base::StringPairs& parsed, 38 void CheckSerialize(const base::StringPairs& parsed,
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[] = {{"", true}, {"www.foo.com", true}, {".foo.com", false}};
49 { "", true },
50 { "www.google.com", true },
51 { ".google.com", false }
52 };
53 49
54 for (size_t i = 0; i < arraysize(tests); ++i) { 50 for (size_t i = 0; i < arraysize(tests); ++i) {
55 EXPECT_EQ(tests[i].is_host_only, 51 EXPECT_EQ(tests[i].is_host_only,
56 cookie_util::DomainIsHostOnly(tests[i].str)); 52 cookie_util::DomainIsHostOnly(tests[i].str));
57 } 53 }
58 } 54 }
59 55
60 TEST(CookieUtilTest, TestCookieDateParsing) { 56 TEST(CookieUtilTest, TestCookieDateParsing) {
61 const struct { 57 const struct {
62 const char* str; 58 const char* str;
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 cookie_util::GetEffectiveDomain("ws", "www.example.com")); 246 cookie_util::GetEffectiveDomain("ws", "www.example.com"));
251 EXPECT_EQ("example.com", 247 EXPECT_EQ("example.com",
252 cookie_util::GetEffectiveDomain("wss", "www.example.com")); 248 cookie_util::GetEffectiveDomain("wss", "www.example.com"));
253 EXPECT_EQ("www.example.com", 249 EXPECT_EQ("www.example.com",
254 cookie_util::GetEffectiveDomain("ftp", "www.example.com")); 250 cookie_util::GetEffectiveDomain("ftp", "www.example.com"));
255 } 251 }
256 252
257 } // namespace 253 } // namespace
258 254
259 } // namespace net 255 } // namespace net
OLDNEW
« no previous file with comments | « net/cookies/cookie_store_unittest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698