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

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

Issue 10447117: Unwire the clear on exit preference from the storage systems. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
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_store_unittest.h" 5 #include "net/cookies/cookie_store_unittest.h"
6 6
7 #include <time.h> 7 #include <time.h>
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 25 matching lines...) Expand all
36 class NewMockPersistentCookieStore 36 class NewMockPersistentCookieStore
37 : public CookieMonster::PersistentCookieStore { 37 : public CookieMonster::PersistentCookieStore {
38 public: 38 public:
39 MOCK_METHOD1(Load, void(const LoadedCallback& loaded_callback)); 39 MOCK_METHOD1(Load, void(const LoadedCallback& loaded_callback));
40 MOCK_METHOD2(LoadCookiesForKey, void(const std::string& key, 40 MOCK_METHOD2(LoadCookiesForKey, void(const std::string& key,
41 const LoadedCallback& loaded_callback)); 41 const LoadedCallback& loaded_callback));
42 MOCK_METHOD1(AddCookie, void(const CookieMonster::CanonicalCookie& cc)); 42 MOCK_METHOD1(AddCookie, void(const CookieMonster::CanonicalCookie& cc));
43 MOCK_METHOD1(UpdateCookieAccessTime, 43 MOCK_METHOD1(UpdateCookieAccessTime,
44 void(const CookieMonster::CanonicalCookie& cc)); 44 void(const CookieMonster::CanonicalCookie& cc));
45 MOCK_METHOD1(DeleteCookie, void(const CookieMonster::CanonicalCookie& cc)); 45 MOCK_METHOD1(DeleteCookie, void(const CookieMonster::CanonicalCookie& cc));
46 MOCK_METHOD1(SetClearLocalStateOnExit, void(bool clear_local_state));
47 MOCK_METHOD1(Flush, void(const base::Closure& callback)); 46 MOCK_METHOD1(Flush, void(const base::Closure& callback));
47 MOCK_METHOD0(SetKeepSessionCookies, void());
48 48
49 private: 49 private:
50 virtual ~NewMockPersistentCookieStore() {} 50 virtual ~NewMockPersistentCookieStore() {}
51 }; 51 };
52 52
53 const char* kTopLevelDomainPlus1 = "http://www.harvard.edu"; 53 const char* kTopLevelDomainPlus1 = "http://www.harvard.edu";
54 const char* kTopLevelDomainPlus2 = "http://www.math.harvard.edu"; 54 const char* kTopLevelDomainPlus2 = "http://www.math.harvard.edu";
55 const char* kTopLevelDomainPlus2Secure = "https://www.math.harvard.edu"; 55 const char* kTopLevelDomainPlus2Secure = "https://www.math.harvard.edu";
56 const char* kTopLevelDomainPlus3 = 56 const char* kTopLevelDomainPlus3 =
57 "http://www.bourbaki.math.harvard.edu"; 57 "http://www.bourbaki.math.harvard.edu";
(...skipping 2155 matching lines...) Expand 10 before | Expand all | Expand 10 after
2213 } 2213 }
2214 2214
2215 void LoadCookiesForKey(const std::string& key, 2215 void LoadCookiesForKey(const std::string& key,
2216 const LoadedCallback& loaded_callback) { 2216 const LoadedCallback& loaded_callback) {
2217 Load(loaded_callback); 2217 Load(loaded_callback);
2218 } 2218 }
2219 2219
2220 void AddCookie(const CookieMonster::CanonicalCookie&) {} 2220 void AddCookie(const CookieMonster::CanonicalCookie&) {}
2221 void UpdateCookieAccessTime(const CookieMonster::CanonicalCookie&) {} 2221 void UpdateCookieAccessTime(const CookieMonster::CanonicalCookie&) {}
2222 void DeleteCookie(const CookieMonster::CanonicalCookie&) {} 2222 void DeleteCookie(const CookieMonster::CanonicalCookie&) {}
2223 void SetClearLocalStateOnExit(bool clear_local_state) {} 2223 void SetKeepSessionCookies() {}
2224 2224
2225 void Flush(const base::Closure& callback) { 2225 void Flush(const base::Closure& callback) {
2226 ++flush_count_; 2226 ++flush_count_;
2227 if (!callback.is_null()) 2227 if (!callback.is_null())
2228 callback.Run(); 2228 callback.Run();
2229 } 2229 }
2230 2230
2231 int flush_count() { 2231 int flush_count() {
2232 return flush_count_; 2232 return flush_count_;
2233 } 2233 }
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
2713 EXPECT_EQ(CookieStoreCommand::ADD, store->commands()[4].type); 2713 EXPECT_EQ(CookieStoreCommand::ADD, store->commands()[4].type);
2714 2714
2715 // Create some non-persistent cookies and check that they don't go to the 2715 // Create some non-persistent cookies and check that they don't go to the
2716 // persistent storage. 2716 // persistent storage.
2717 EXPECT_TRUE(SetCookie(cm, url_google_, "B=Bar")); 2717 EXPECT_TRUE(SetCookie(cm, url_google_, "B=Bar"));
2718 this->MatchCookieLines("A=Foo; B=Bar", GetCookies(cm, url_google_)); 2718 this->MatchCookieLines("A=Foo; B=Bar", GetCookies(cm, url_google_));
2719 EXPECT_EQ(5u, store->commands().size()); 2719 EXPECT_EQ(5u, store->commands().size());
2720 } 2720 }
2721 2721
2722 } // namespace net 2722 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698