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

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

Issue 2103863003: Make CanonicalCookie::Source() private. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@source
Patch Set: Merge Created 4 years, 5 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_monster.cc ('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 "net/cookies/cookie_monster.h" 5 #include "net/cookies/cookie_monster.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 CookieMonster* CreateMonsterForGC(int num_cookies) { 780 CookieMonster* CreateMonsterForGC(int num_cookies) {
781 CookieMonster* cm(new CookieMonster(NULL, NULL)); 781 CookieMonster* cm(new CookieMonster(NULL, NULL));
782 for (int i = 0; i < num_cookies; i++) { 782 for (int i = 0; i < num_cookies; i++) {
783 SetCookie(cm, GURL(base::StringPrintf("http://h%05d.izzle", i)), "a=1"); 783 SetCookie(cm, GURL(base::StringPrintf("http://h%05d.izzle", i)), "a=1");
784 } 784 }
785 return cm; 785 return cm;
786 } 786 }
787 787
788 bool IsCookieInList(const CanonicalCookie& cookie, const CookieList& list) { 788 bool IsCookieInList(const CanonicalCookie& cookie, const CookieList& list) {
789 for (CookieList::const_iterator it = list.begin(); it != list.end(); ++it) { 789 for (CookieList::const_iterator it = list.begin(); it != list.end(); ++it) {
790 if (it->Source() == cookie.Source() && it->Name() == cookie.Name() && 790 if (it->Name() == cookie.Name() && it->Value() == cookie.Value() &&
791 it->Value() == cookie.Value() && it->Domain() == cookie.Domain() && 791 it->Domain() == cookie.Domain() && it->Path() == cookie.Path() &&
792 it->Path() == cookie.Path() &&
793 it->CreationDate() == cookie.CreationDate() && 792 it->CreationDate() == cookie.CreationDate() &&
794 it->ExpiryDate() == cookie.ExpiryDate() && 793 it->ExpiryDate() == cookie.ExpiryDate() &&
795 it->LastAccessDate() == cookie.LastAccessDate() && 794 it->LastAccessDate() == cookie.LastAccessDate() &&
796 it->IsSecure() == cookie.IsSecure() && 795 it->IsSecure() == cookie.IsSecure() &&
797 it->IsHttpOnly() == cookie.IsHttpOnly() && 796 it->IsHttpOnly() == cookie.IsHttpOnly() &&
798 it->Priority() == cookie.Priority()) { 797 it->Priority() == cookie.Priority()) {
799 return true; 798 return true;
800 } 799 }
801 } 800 }
802 801
(...skipping 2681 matching lines...) Expand 10 before | Expand all | Expand 10 after
3484 monster()->AddCallbackForCookie( 3483 monster()->AddCallbackForCookie(
3485 test_url_, "abc", 3484 test_url_, "abc",
3486 base::Bind(&RecordCookieChanges, &cookies1, nullptr))); 3485 base::Bind(&RecordCookieChanges, &cookies1, nullptr)));
3487 SetCookie(monster(), test_url_, "abc=def"); 3486 SetCookie(monster(), test_url_, "abc=def");
3488 base::RunLoop().RunUntilIdle(); 3487 base::RunLoop().RunUntilIdle();
3489 EXPECT_EQ(1U, cookies0.size()); 3488 EXPECT_EQ(1U, cookies0.size());
3490 EXPECT_EQ(1U, cookies0.size()); 3489 EXPECT_EQ(1U, cookies0.size());
3491 } 3490 }
3492 3491
3493 } // namespace net 3492 } // namespace net
OLDNEW
« no previous file with comments | « net/cookies/cookie_monster.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698