summaryrefslogtreecommitdiffstats
path: root/net/cookies/cookie_monster_store_test.h
diff options
context:
space:
mode:
authorbattre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-18 13:13:34 +0000
committerbattre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-18 13:13:34 +0000
commit5b9bc3505d5cd23898d0bdb350f33956070cc3a6 (patch)
tree2e28070459f0324ce2dd9288e803f8aa095781fd /net/cookies/cookie_monster_store_test.h
parent64c186bdf8949a84c1b1e53da12710f50e51336b (diff)
downloadchromium_src-5b9bc3505d5cd23898d0bdb350f33956070cc3a6.zip
chromium_src-5b9bc3505d5cd23898d0bdb350f33956070cc3a6.tar.gz
chromium_src-5b9bc3505d5cd23898d0bdb350f33956070cc3a6.tar.bz2
Move CanonicalCookie into separate files
BUG=137014,112155 TEST=no TBR=sky@chromium.org, erg@chromium.org, tony@chromium.org, eroman@chromium.org Review URL: https://chromiumcodereview.appspot.com/10785017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147222 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/cookies/cookie_monster_store_test.h')
-rw-r--r--net/cookies/cookie_monster_store_test.h45
1 files changed, 20 insertions, 25 deletions
diff --git a/net/cookies/cookie_monster_store_test.h b/net/cookies/cookie_monster_store_test.h
index 265bd77..d7da521 100644
--- a/net/cookies/cookie_monster_store_test.h
+++ b/net/cookies/cookie_monster_store_test.h
@@ -14,6 +14,7 @@
#include <string>
#include <utility>
#include <vector>
+#include "net/cookies/canonical_cookie.h"
#include "net/cookies/cookie_monster.h"
namespace base {
@@ -31,7 +32,7 @@ class LoadedCallbackTask
typedef CookieMonster::PersistentCookieStore::LoadedCallback LoadedCallback;
LoadedCallbackTask(LoadedCallback loaded_callback,
- std::vector<CookieMonster::CanonicalCookie*> cookies);
+ std::vector<CanonicalCookie*> cookies);
void Run() {
loaded_callback_.Run(cookies_);
@@ -42,7 +43,7 @@ class LoadedCallbackTask
~LoadedCallbackTask();
LoadedCallback loaded_callback_;
- std::vector<CookieMonster::CanonicalCookie*> cookies_;
+ std::vector<CanonicalCookie*> cookies_;
DISALLOW_COPY_AND_ASSIGN(LoadedCallbackTask);
}; // Wrapper class LoadedCallbackTask
@@ -55,13 +56,12 @@ struct CookieStoreCommand {
REMOVE,
};
- CookieStoreCommand(Type type,
- const CookieMonster::CanonicalCookie& cookie)
+ CookieStoreCommand(Type type, const CanonicalCookie& cookie)
: type(type),
cookie(cookie) {}
Type type;
- CookieMonster::CanonicalCookie cookie;
+ CanonicalCookie cookie;
};
// Implementation of PersistentCookieStore that captures the
@@ -76,7 +76,7 @@ class MockPersistentCookieStore
void SetLoadExpectation(
bool return_value,
- const std::vector<CookieMonster::CanonicalCookie*>& result);
+ const std::vector<CanonicalCookie*>& result);
const CommandList& commands() const {
return commands_;
@@ -87,13 +87,13 @@ class MockPersistentCookieStore
virtual void LoadCookiesForKey(const std::string& key,
const LoadedCallback& loaded_callback) OVERRIDE;
- virtual void AddCookie(const CookieMonster::CanonicalCookie& cookie) OVERRIDE;
+ virtual void AddCookie(const CanonicalCookie& cookie) OVERRIDE;
virtual void UpdateCookieAccessTime(
- const CookieMonster::CanonicalCookie& cookie) OVERRIDE;
+ const CanonicalCookie& cookie) OVERRIDE;
virtual void DeleteCookie(
- const CookieMonster::CanonicalCookie& cookie) OVERRIDE;
+ const CanonicalCookie& cookie) OVERRIDE;
virtual void Flush(const base::Closure& callback) OVERRIDE;
@@ -107,7 +107,7 @@ class MockPersistentCookieStore
// Deferred result to use when Load() is called.
bool load_return_value_;
- std::vector<CookieMonster::CanonicalCookie*> load_result_;
+ std::vector<CanonicalCookie*> load_result_;
// Indicates if the store has been fully loaded to avoid returning duplicate
// cookies.
bool loaded_;
@@ -118,7 +118,7 @@ class MockPersistentCookieStore
// Mock for CookieMonster::Delegate
class MockCookieMonsterDelegate : public CookieMonster::Delegate {
public:
- typedef std::pair<CookieMonster::CanonicalCookie, bool>
+ typedef std::pair<CanonicalCookie, bool>
CookieNotification;
MockCookieMonsterDelegate();
@@ -128,7 +128,7 @@ class MockCookieMonsterDelegate : public CookieMonster::Delegate {
void reset() { changes_.clear(); }
virtual void OnCookieChanged(
- const CookieMonster::CanonicalCookie& cookie,
+ const CanonicalCookie& cookie,
bool removed,
CookieMonster::Delegate::ChangeCause cause) OVERRIDE;
@@ -141,17 +141,16 @@ class MockCookieMonsterDelegate : public CookieMonster::Delegate {
};
// Helper to build a single CanonicalCookie.
-CookieMonster::CanonicalCookie BuildCanonicalCookie(
- const std::string& key,
- const std::string& cookie_line,
- const base::Time& creation_time);
+CanonicalCookie BuildCanonicalCookie(const std::string& key,
+ const std::string& cookie_line,
+ const base::Time& creation_time);
// Helper to build a list of CanonicalCookie*s.
void AddCookieToList(
const std::string& key,
const std::string& cookie_line,
const base::Time& creation_time,
- std::vector<CookieMonster::CanonicalCookie*>* out_list);
+ std::vector<CanonicalCookie*>* out_list);
// Just act like a backing database. Keep cookie information from
// Add/Update/Delete and regurgitate it when Load is called.
@@ -165,14 +164,11 @@ class MockSimplePersistentCookieStore
virtual void LoadCookiesForKey(const std::string& key,
const LoadedCallback& loaded_callback) OVERRIDE;
- virtual void AddCookie(
- const CookieMonster::CanonicalCookie& cookie) OVERRIDE;
+ virtual void AddCookie(const CanonicalCookie& cookie) OVERRIDE;
- virtual void UpdateCookieAccessTime(
- const CookieMonster::CanonicalCookie& cookie) OVERRIDE;
+ virtual void UpdateCookieAccessTime(const CanonicalCookie& cookie) OVERRIDE;
- virtual void DeleteCookie(
- const CookieMonster::CanonicalCookie& cookie) OVERRIDE;
+ virtual void DeleteCookie(const CanonicalCookie& cookie) OVERRIDE;
virtual void Flush(const base::Closure& callback) OVERRIDE;
@@ -182,8 +178,7 @@ class MockSimplePersistentCookieStore
virtual ~MockSimplePersistentCookieStore();
private:
- typedef std::map<int64, CookieMonster::CanonicalCookie>
- CanonicalCookieMap;
+ typedef std::map<int64, CanonicalCookie> CanonicalCookieMap;
CanonicalCookieMap cookies_;