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

Unified Diff: chrome/browser/cookies_tree_model_unittest.cc

Issue 650110: Teach the cookie tree view / model about appcaches. Not hooked up to real dat... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 10 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 | « chrome/browser/cookies_tree_model.cc ('k') | chrome/browser/gtk/options/cookie_filter_page_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cookies_tree_model_unittest.cc
===================================================================
--- chrome/browser/cookies_tree_model_unittest.cc (revision 40156)
+++ chrome/browser/cookies_tree_model_unittest.cc (working copy)
@@ -7,6 +7,7 @@
#include <string>
#include "app/l10n_util.h"
+#include "chrome/browser/mock_browsing_data_appcache_helper.h"
#include "chrome/browser/mock_browsing_data_database_helper.h"
#include "chrome/browser/mock_browsing_data_local_storage_helper.h"
#include "chrome/browser/net/url_request_context_getter.h"
@@ -32,6 +33,8 @@
new MockBrowsingDataDatabaseHelper(profile_.get());
mock_browsing_data_local_storage_helper_ =
new MockBrowsingDataLocalStorageHelper(profile_.get());
+ mock_browsing_data_appcache_helper_ =
+ new MockBrowsingDataAppCacheHelper(profile_.get());
}
CookiesTreeModel* CreateCookiesTreeModelWithInitialSample() {
@@ -41,7 +44,8 @@
monster->SetCookie(GURL("http://foo3"), "C=1");
CookiesTreeModel* cookies_model = new CookiesTreeModel(
profile_.get(), mock_browsing_data_database_helper_,
- mock_browsing_data_local_storage_helper_);
+ mock_browsing_data_local_storage_helper_,
+ mock_browsing_data_appcache_helper_);
mock_browsing_data_database_helper_->AddDatabaseSamples();
mock_browsing_data_database_helper_->Notify();
mock_browsing_data_local_storage_helper_->AddLocalStorageSamples();
@@ -91,6 +95,9 @@
return node->GetDetailedInfo().database_info->database_name + ",";
case CookieTreeNode::DetailedInfo::TYPE_COOKIE:
return node->GetDetailedInfo().cookie->second.Name() + ",";
+ case CookieTreeNode::DetailedInfo::TYPE_APPCACHE:
+ return node->GetDetailedInfo().appcache_info->manifest_url.spec() +
+ ",";
default:
return "";
}
@@ -142,6 +149,11 @@
CookieTreeNode::DetailedInfo::TYPE_LOCAL_STORAGE);
}
+ std::string GetDisplayedAppCaches(CookiesTreeModel* cookies_model) {
+ return GetDisplayedNodes(cookies_model,
+ CookieTreeNode::DetailedInfo::TYPE_APPCACHE);
+ }
+
// do not call on the root
void DeleteStoredObjects(CookieTreeNode* node) {
node->DeleteStoredObjects();
@@ -160,6 +172,8 @@
mock_browsing_data_database_helper_;
scoped_refptr<MockBrowsingDataLocalStorageHelper>
mock_browsing_data_local_storage_helper_;
+ scoped_refptr<MockBrowsingDataAppCacheHelper>
+ mock_browsing_data_appcache_helper_;
};
TEST_F(CookiesTreeModelTest, RemoveAll) {
@@ -327,7 +341,8 @@
monster->SetCookie(GURL("http://foo3"), "D=1");
CookiesTreeModel cookies_model(profile_.get(),
mock_browsing_data_database_helper_,
- mock_browsing_data_local_storage_helper_);
+ mock_browsing_data_local_storage_helper_,
+ mock_browsing_data_appcache_helper_);
mock_browsing_data_database_helper_->AddDatabaseSamples();
mock_browsing_data_database_helper_->Notify();
mock_browsing_data_local_storage_helper_->AddLocalStorageSamples();
@@ -365,7 +380,8 @@
monster->SetCookie(GURL("http://foo3"), "E=1");
CookiesTreeModel cookies_model(profile_.get(),
mock_browsing_data_database_helper_,
- mock_browsing_data_local_storage_helper_);
+ mock_browsing_data_local_storage_helper_,
+ mock_browsing_data_appcache_helper_);
mock_browsing_data_database_helper_->AddDatabaseSamples();
mock_browsing_data_database_helper_->Notify();
mock_browsing_data_local_storage_helper_->AddLocalStorageSamples();
@@ -403,8 +419,9 @@
monster->SetCookie(GURL("http://foo3"), "D=1");
monster->SetCookie(GURL("http://foo3"), "E=1");
CookiesTreeModel cookies_model(profile_.get(),
- mock_browsing_data_database_helper_,
- mock_browsing_data_local_storage_helper_);
+ mock_browsing_data_database_helper_,
+ mock_browsing_data_local_storage_helper_,
+ mock_browsing_data_appcache_helper_);
{
SCOPED_TRACE("Initial State 5 cookies");
// 11 because there's the root, then foo1 -> cookies -> a,
@@ -437,7 +454,8 @@
CookiesTreeModel cookies_model(profile_.get(),
new MockBrowsingDataDatabaseHelper(profile_.get()),
- new MockBrowsingDataLocalStorageHelper(profile_.get()));
+ new MockBrowsingDataLocalStorageHelper(profile_.get()),
+ new MockBrowsingDataAppCacheHelper(profile_.get()));
{
SCOPED_TRACE("Initial State 8 cookies");
@@ -454,6 +472,4 @@
}
}
-
-
} // namespace
« no previous file with comments | « chrome/browser/cookies_tree_model.cc ('k') | chrome/browser/gtk/options/cookie_filter_page_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698