diff options
author | ycxiao@chromium.org <ycxiao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-04 23:28:15 +0000 |
---|---|---|
committer | ycxiao@chromium.org <ycxiao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-04 23:28:15 +0000 |
commit | a4d965d6457ad587e19821eb5541082e3d17fdc9 (patch) | |
tree | 783cce366834675ed1080c23885a2484500a8f52 /chrome/browser/mock_browsing_data_cookie_helper.h | |
parent | 199f0db1e6024df05750b6560cd6a672909864c2 (diff) | |
download | chromium_src-a4d965d6457ad587e19821eb5541082e3d17fdc9.zip chromium_src-a4d965d6457ad587e19821eb5541082e3d17fdc9.tar.gz chromium_src-a4d965d6457ad587e19821eb5541082e3d17fdc9.tar.bz2 |
Creat BrowsingDataCookieHelper and CannedBrowsingDataCookieHelper for logging cookies at UI thread.
BUG=XXX
TEST=XXX
Review URL: http://codereview.chromium.org/7355025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95534 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/mock_browsing_data_cookie_helper.h')
-rw-r--r-- | chrome/browser/mock_browsing_data_cookie_helper.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/chrome/browser/mock_browsing_data_cookie_helper.h b/chrome/browser/mock_browsing_data_cookie_helper.h new file mode 100644 index 0000000..723e9b5 --- /dev/null +++ b/chrome/browser/mock_browsing_data_cookie_helper.h @@ -0,0 +1,50 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_MOCK_BROWSING_DATA_COOKIE_HELPER_H_ +#define CHROME_BROWSER_MOCK_BROWSING_DATA_COOKIE_HELPER_H_ +#pragma once + +#include <map> +#include <string> + +#include "chrome/browser/browsing_data_cookie_helper.h" + +// Mock for BrowsingDataCookieHelper. +class MockBrowsingDataCookieHelper : public BrowsingDataCookieHelper { + public: + explicit MockBrowsingDataCookieHelper(Profile* profile); + + // BrowsingDataCookieHelper methods. + virtual void StartFetching( + const net::CookieMonster::GetCookieListCallback &callback); + virtual void CancelNotification(); + virtual void DeleteCookie(const net::CookieMonster::CanonicalCookie& cookie); + + // Adds some cookie samples. + void AddCookieSamples(const GURL& url, const std::string& cookie_line); + + // Notifies the callback. + void Notify(); + + // Marks all cookies as existing. + void Reset(); + + // Returns true if all cookies since the last Reset() invocation were + // deleted. + bool AllDeleted(); + + private: + virtual ~MockBrowsingDataCookieHelper(); + + Profile* profile_; + net::CookieMonster::GetCookieListCallback callback_; + + net::CookieList cookie_list_; + + // Stores which cookies exist. + std::map<const std::string, bool> cookies_; +}; + +#endif // CHROME_BROWSER_MOCK_BROWSING_DATA_COOKIE_HELPER_H_ |