OLD | NEW |
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 // This file contains test infrastructure for multiple files | 5 // This file contains test infrastructure for multiple files |
6 // (current cookie_monster_unittest.cc and cookie_monster_perftest.cc) | 6 // (current cookie_monster_unittest.cc and cookie_monster_perftest.cc) |
7 // that need to test out CookieMonster interactions with the backing store. | 7 // that need to test out CookieMonster interactions with the backing store. |
8 // It should only be included by test code. | 8 // It should only be included by test code. |
9 | 9 |
10 #ifndef NET_COOKIES_COOKIE_MONSTER_STORE_TEST_H_ | 10 #ifndef NET_COOKIES_COOKIE_MONSTER_STORE_TEST_H_ |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 125 |
126 const std::vector<CookieNotification>& changes() const { return changes_; } | 126 const std::vector<CookieNotification>& changes() const { return changes_; } |
127 | 127 |
128 void reset() { changes_.clear(); } | 128 void reset() { changes_.clear(); } |
129 | 129 |
130 virtual void OnCookieChanged( | 130 virtual void OnCookieChanged( |
131 const CanonicalCookie& cookie, | 131 const CanonicalCookie& cookie, |
132 bool removed, | 132 bool removed, |
133 CookieMonsterDelegate::ChangeCause cause) OVERRIDE; | 133 CookieMonsterDelegate::ChangeCause cause) OVERRIDE; |
134 | 134 |
135 virtual void OnLoaded() OVERRIDE; | |
136 | |
137 private: | 135 private: |
138 virtual ~MockCookieMonsterDelegate(); | 136 virtual ~MockCookieMonsterDelegate(); |
139 | 137 |
140 std::vector<CookieNotification> changes_; | 138 std::vector<CookieNotification> changes_; |
141 | 139 |
142 DISALLOW_COPY_AND_ASSIGN(MockCookieMonsterDelegate); | 140 DISALLOW_COPY_AND_ASSIGN(MockCookieMonsterDelegate); |
143 }; | 141 }; |
144 | 142 |
145 // Helper to build a single CanonicalCookie. | 143 // Helper to build a single CanonicalCookie. |
146 CanonicalCookie BuildCanonicalCookie(const std::string& key, | 144 CanonicalCookie BuildCanonicalCookie(const std::string& key, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 // longer than |gc_perf_micros| to complete, and how many cookie were | 196 // longer than |gc_perf_micros| to complete, and how many cookie were |
199 // left in the store afterwards. | 197 // left in the store afterwards. |
200 CookieMonster* CreateMonsterFromStoreForGC( | 198 CookieMonster* CreateMonsterFromStoreForGC( |
201 int num_cookies, | 199 int num_cookies, |
202 int num_old_cookies, | 200 int num_old_cookies, |
203 int days_old); | 201 int days_old); |
204 | 202 |
205 } // namespace net | 203 } // namespace net |
206 | 204 |
207 #endif // NET_COOKIES_COOKIE_MONSTER_STORE_TEST_H_ | 205 #endif // NET_COOKIES_COOKIE_MONSTER_STORE_TEST_H_ |
OLD | NEW |