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

Side by Side Diff: net/cookies/cookie_store_unittest.h

Issue 1507513003: [iOS] Disable more parts of TestNonDottedAndTLD cookie store unittest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2564
Patch Set: Created 5 years 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 | « no previous file | 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 #ifndef NET_COOKIES_COOKIE_STORE_UNITTEST_H_ 5 #ifndef NET_COOKIES_COOKIE_STORE_UNITTEST_H_
6 #define NET_COOKIES_COOKIE_STORE_UNITTEST_H_ 6 #define NET_COOKIES_COOKIE_STORE_UNITTEST_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 // exactly. This matches IE/Firefox, even though it seems a bit wrong. 502 // exactly. This matches IE/Firefox, even though it seems a bit wrong.
503 EXPECT_FALSE(this->SetCookie(cs.get(), url_ip, "b=2; domain=1.2.3.3")); 503 EXPECT_FALSE(this->SetCookie(cs.get(), url_ip, "b=2; domain=1.2.3.3"));
504 this->MatchCookieLines(std::string(), this->GetCookies(cs.get(), url_ip)); 504 this->MatchCookieLines(std::string(), this->GetCookies(cs.get(), url_ip));
505 EXPECT_TRUE(this->SetCookie(cs.get(), url_ip, "b=2; domain=1.2.3.4")); 505 EXPECT_TRUE(this->SetCookie(cs.get(), url_ip, "b=2; domain=1.2.3.4"));
506 this->MatchCookieLines("b=2", this->GetCookies(cs.get(), url_ip)); 506 this->MatchCookieLines("b=2", this->GetCookies(cs.get(), url_ip));
507 } 507 }
508 } 508 }
509 509
510 // Test host cookies, and setting of cookies on TLD. 510 // Test host cookies, and setting of cookies on TLD.
511 TYPED_TEST_P(CookieStoreTest, TestNonDottedAndTLD) { 511 TYPED_TEST_P(CookieStoreTest, TestNonDottedAndTLD) {
512 { 512 if (TypeParam::supports_non_dotted_domains) {
513 scoped_refptr<CookieStore> cs(this->GetCookieStore()); 513 scoped_refptr<CookieStore> cs(this->GetCookieStore());
514 GURL url("http://com/"); 514 GURL url("http://com/");
515 // Allow setting on "com", (but only as a host cookie). 515 // Allow setting on "com", (but only as a host cookie).
516 EXPECT_TRUE(this->SetCookie(cs.get(), url, "a=1")); 516 EXPECT_TRUE(this->SetCookie(cs.get(), url, "a=1"));
517 EXPECT_FALSE(this->SetCookie(cs.get(), url, "b=2; domain=.com")); 517 EXPECT_FALSE(this->SetCookie(cs.get(), url, "b=2; domain=.com"));
518 518
519 this->MatchCookieLines("a=1", this->GetCookies(cs.get(), url)); 519 this->MatchCookieLines("a=1", this->GetCookies(cs.get(), url));
520 // Make sure it doesn't show up for a normal .com, it should be a host 520 // Make sure it doesn't show up for a normal .com, it should be a host
521 // not a domain cookie. 521 // not a domain cookie.
522 this->MatchCookieLines( 522 this->MatchCookieLines(
523 std::string(), 523 std::string(),
524 this->GetCookies(cs.get(), GURL("http://hopefully-no-cookies.com/"))); 524 this->GetCookies(cs.get(), GURL("http://hopefully-no-cookies.com/")));
525 if (TypeParam::supports_non_dotted_domains) { 525 this->MatchCookieLines(std::string(),
526 this->MatchCookieLines(std::string(), 526 this->GetCookies(cs.get(), GURL("http://.com/")));
527 this->GetCookies(cs.get(), GURL("http://.com/")));
528 }
529 } 527 }
530 528
531 if (TypeParam::supports_non_dotted_domains) { 529 if (TypeParam::supports_non_dotted_domains) {
532 // Exact matches between the domain attribute and the host are treated as 530 // Exact matches between the domain attribute and the host are treated as
533 // host cookies, not domain cookies. 531 // host cookies, not domain cookies.
534 scoped_refptr<CookieStore> cs(this->GetCookieStore()); 532 scoped_refptr<CookieStore> cs(this->GetCookieStore());
535 GURL url("http://com/"); 533 GURL url("http://com/");
536 EXPECT_TRUE(this->SetCookie(cs.get(), url, "a=1; domain=com")); 534 EXPECT_TRUE(this->SetCookie(cs.get(), url, "a=1; domain=com"));
537 535
538 this->MatchCookieLines("a=1", this->GetCookies(cs.get(), url)); 536 this->MatchCookieLines("a=1", this->GetCookies(cs.get(), url));
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
1275 REGISTER_TYPED_TEST_CASE_P(MultiThreadedCookieStoreTest, 1273 REGISTER_TYPED_TEST_CASE_P(MultiThreadedCookieStoreTest,
1276 ThreadCheckGetCookies, 1274 ThreadCheckGetCookies,
1277 ThreadCheckGetCookiesWithOptions, 1275 ThreadCheckGetCookiesWithOptions,
1278 ThreadCheckSetCookieWithOptions, 1276 ThreadCheckSetCookieWithOptions,
1279 ThreadCheckDeleteCookie, 1277 ThreadCheckDeleteCookie,
1280 ThreadCheckDeleteSessionCookies); 1278 ThreadCheckDeleteSessionCookies);
1281 1279
1282 } // namespace net 1280 } // namespace net
1283 1281
1284 #endif // NET_COOKIES_COOKIE_STORE_UNITTEST_H_ 1282 #endif // NET_COOKIES_COOKIE_STORE_UNITTEST_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698