Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Unified Diff: net/cookies/cookie_store_test_helpers.h

Issue 1378273003: Decouple CookieMonsterTest from CookieStoreTest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved (and renamed) URLHelper into own class/file Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cookies/cookie_monster_unittest.cc ('k') | net/cookies/cookie_store_test_helpers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cookies/cookie_store_test_helpers.h
diff --git a/net/cookies/cookie_store_test_helpers.h b/net/cookies/cookie_store_test_helpers.h
index 760b847846c2ed3ff84d52a6eea718b6fde62e6f..1750c7f07bdf037d92d6e392b97a14b4743b7b20 100644
--- a/net/cookies/cookie_store_test_helpers.h
+++ b/net/cookies/cookie_store_test_helpers.h
@@ -70,7 +70,6 @@ class DelayedCookieMonster : public CookieStore {
const CookieChangedCallback& callback) override;
private:
-
// Be called immediately from CookieMonster.
void SetCookiesInternalCallback(bool result);
@@ -96,6 +95,26 @@ class DelayedCookieMonster : public CookieStore {
std::string cookie_line_;
};
+class CookieURLHelper {
+ public:
+ explicit CookieURLHelper(const std::string& url_string);
+
+ const std::string& domain() const { return domain_and_registry_; }
+ std::string host() const { return url_.host(); }
+ const GURL& url() const { return url_; }
+ const GURL AppendPath(const std::string& path) const;
+
+ // Return a new string with the following substitutions:
+ // 1. "%R" -> Domain registry (i.e. "com")
+ // 2. "%D" -> Domain + registry (i.e. "google.com")
+ std::string Format(const std::string& format_string) const;
+
+ private:
+ const GURL url_;
+ const std::string registry_;
+ const std::string domain_and_registry_;
+};
+
} // namespace net
#endif // NET_COOKIES_COOKIE_STORE_TEST_HELPERS_H_
« no previous file with comments | « net/cookies/cookie_monster_unittest.cc ('k') | net/cookies/cookie_store_test_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698