| 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 |
| 135 private: | 137 private: |
| 136 virtual ~MockCookieMonsterDelegate(); | 138 virtual ~MockCookieMonsterDelegate(); |
| 137 | 139 |
| 138 std::vector<CookieNotification> changes_; | 140 std::vector<CookieNotification> changes_; |
| 139 | 141 |
| 140 DISALLOW_COPY_AND_ASSIGN(MockCookieMonsterDelegate); | 142 DISALLOW_COPY_AND_ASSIGN(MockCookieMonsterDelegate); |
| 141 }; | 143 }; |
| 142 | 144 |
| 143 // Helper to build a single CanonicalCookie. | 145 // Helper to build a single CanonicalCookie. |
| 144 CanonicalCookie BuildCanonicalCookie(const std::string& key, | 146 CanonicalCookie BuildCanonicalCookie(const std::string& key, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 // longer than |gc_perf_micros| to complete, and how many cookie were | 198 // longer than |gc_perf_micros| to complete, and how many cookie were |
| 197 // left in the store afterwards. | 199 // left in the store afterwards. |
| 198 CookieMonster* CreateMonsterFromStoreForGC( | 200 CookieMonster* CreateMonsterFromStoreForGC( |
| 199 int num_cookies, | 201 int num_cookies, |
| 200 int num_old_cookies, | 202 int num_old_cookies, |
| 201 int days_old); | 203 int days_old); |
| 202 | 204 |
| 203 } // namespace net | 205 } // namespace net |
| 204 | 206 |
| 205 #endif // NET_COOKIES_COOKIE_MONSTER_STORE_TEST_H_ | 207 #endif // NET_COOKIES_COOKIE_MONSTER_STORE_TEST_H_ |
| OLD | NEW |