#include "net/cookies/cookie_monster_store_test.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/strings/stringprintf.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
#include "net/cookies/cookie_constants.h"
#include "net/cookies/cookie_util.h"
#include "net/cookies/parsed_cookie.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace net {
CookieStoreCommand::CookieStoreCommand(
Type type,
CookieMonster::PersistentCookieStore::LoadedCallback loaded_callback,
const std::string& key)
: … { … }
CookieStoreCommand::CookieStoreCommand(Type type, const CanonicalCookie& cookie)
: … { … }
CookieStoreCommand::CookieStoreCommand(CookieStoreCommand&& other) = default;
CookieStoreCommand::~CookieStoreCommand() = default;
MockPersistentCookieStore::MockPersistentCookieStore() = default;
void MockPersistentCookieStore::SetLoadExpectation(
bool return_value,
std::vector<std::unique_ptr<CanonicalCookie>> result) { … }
void MockPersistentCookieStore::Load(LoadedCallback loaded_callback,
const NetLogWithSource& ) { … }
void MockPersistentCookieStore::LoadCookiesForKey(
const std::string& key,
LoadedCallback loaded_callback) { … }
void MockPersistentCookieStore::AddCookie(const CanonicalCookie& cookie) { … }
void MockPersistentCookieStore::UpdateCookieAccessTime(
const CanonicalCookie& cookie) { … }
void MockPersistentCookieStore::DeleteCookie(const CanonicalCookie& cookie) { … }
void MockPersistentCookieStore::SetForceKeepSessionState() { … }
void MockPersistentCookieStore::SetBeforeCommitCallback(
base::RepeatingClosure callback) { … }
void MockPersistentCookieStore::Flush(base::OnceClosure callback) { … }
MockPersistentCookieStore::~MockPersistentCookieStore() = default;
std::unique_ptr<CanonicalCookie> BuildCanonicalCookie(
const GURL& url,
const std::string& cookie_line,
const base::Time& creation_time) { … }
void AddCookieToList(const GURL& url,
const std::string& cookie_line,
const base::Time& creation_time,
std::vector<std::unique_ptr<CanonicalCookie>>* out_list) { … }
MockSimplePersistentCookieStore::MockSimplePersistentCookieStore() = default;
void MockSimplePersistentCookieStore::Load(
LoadedCallback loaded_callback,
const NetLogWithSource& ) { … }
void MockSimplePersistentCookieStore::LoadCookiesForKey(
const std::string& key,
LoadedCallback loaded_callback) { … }
void MockSimplePersistentCookieStore::AddCookie(const CanonicalCookie& cookie) { … }
void MockSimplePersistentCookieStore::UpdateCookieAccessTime(
const CanonicalCookie& cookie) { … }
void MockSimplePersistentCookieStore::DeleteCookie(
const CanonicalCookie& cookie) { … }
void MockSimplePersistentCookieStore::SetForceKeepSessionState() { … }
void MockSimplePersistentCookieStore::SetBeforeCommitCallback(
base::RepeatingClosure callback) { … }
void MockSimplePersistentCookieStore::Flush(base::OnceClosure callback) { … }
std::unique_ptr<CookieMonster> CreateMonsterFromStoreForGC(
int num_secure_cookies,
int num_old_secure_cookies,
int num_non_secure_cookies,
int num_old_non_secure_cookies,
int days_old) { … }
MockSimplePersistentCookieStore::~MockSimplePersistentCookieStore() = default;
}