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

Unified Diff: chrome/browser/ui/cocoa/content_settings/cookie_details_unittest.mm

Issue 1297093002: Cache Storage API: Hook up to chrome://settings/cookies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase onto https://codereview.chromium.org/1297023004 Created 5 years, 4 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
Index: chrome/browser/ui/cocoa/content_settings/cookie_details_unittest.mm
diff --git a/chrome/browser/ui/cocoa/content_settings/cookie_details_unittest.mm b/chrome/browser/ui/cocoa/content_settings/cookie_details_unittest.mm
index 7a3c8e71b6014f141504ea79e5a59c3078b16d52..7e79313ebd6273dca06b9e1b94986ffe4d7b78b1 100644
--- a/chrome/browser/ui/cocoa/content_settings/cookie_details_unittest.mm
+++ b/chrome/browser/ui/cocoa/content_settings/cookie_details_unittest.mm
@@ -51,6 +51,7 @@ TEST_F(CookiesDetailsTest, CreateForCookie) {
EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]);
EXPECT_FALSE([details.get() shouldShowAppCachePromptDetailsView]);
EXPECT_FALSE([details.get() shouldShowServiceWorkerTreeDetailsView]);
+ EXPECT_FALSE([details.get() shouldShowCacheStorageTreeDetailsView]);
}
TEST_F(CookiesDetailsTest, CreateForTreeDatabase) {
@@ -82,6 +83,7 @@ TEST_F(CookiesDetailsTest, CreateForTreeDatabase) {
EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]);
EXPECT_FALSE([details.get() shouldShowAppCachePromptDetailsView]);
EXPECT_FALSE([details.get() shouldShowServiceWorkerTreeDetailsView]);
+ EXPECT_FALSE([details.get() shouldShowCacheStorageTreeDetailsView]);
}
TEST_F(CookiesDetailsTest, CreateForTreeLocalStorage) {
@@ -107,6 +109,7 @@ TEST_F(CookiesDetailsTest, CreateForTreeLocalStorage) {
EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]);
EXPECT_FALSE([details.get() shouldShowAppCachePromptDetailsView]);
EXPECT_FALSE([details.get() shouldShowServiceWorkerTreeDetailsView]);
+ EXPECT_FALSE([details.get() shouldShowCacheStorageTreeDetailsView]);
}
TEST_F(CookiesDetailsTest, CreateForTreeAppCache) {
@@ -137,6 +140,7 @@ TEST_F(CookiesDetailsTest, CreateForTreeAppCache) {
EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]);
EXPECT_FALSE([details.get() shouldShowAppCachePromptDetailsView]);
EXPECT_FALSE([details.get() shouldShowServiceWorkerTreeDetailsView]);
+ EXPECT_FALSE([details.get() shouldShowCacheStorageTreeDetailsView]);
}
TEST_F(CookiesDetailsTest, CreateForTreeIndexedDB) {
@@ -166,6 +170,7 @@ TEST_F(CookiesDetailsTest, CreateForTreeIndexedDB) {
EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]);
EXPECT_FALSE([details.get() shouldShowAppCachePromptDetailsView]);
EXPECT_FALSE([details.get() shouldShowServiceWorkerTreeDetailsView]);
+ EXPECT_FALSE([details.get() shouldShowCacheStorageTreeDetailsView]);
}
TEST_F(CookiesDetailsTest, CreateForPromptDatabase) {
@@ -193,6 +198,7 @@ TEST_F(CookiesDetailsTest, CreateForPromptDatabase) {
EXPECT_TRUE([details.get() shouldShowDatabasePromptDetailsView]);
EXPECT_FALSE([details.get() shouldShowAppCachePromptDetailsView]);
EXPECT_FALSE([details.get() shouldShowServiceWorkerTreeDetailsView]);
+ EXPECT_FALSE([details.get() shouldShowCacheStorageTreeDetailsView]);
}
TEST_F(CookiesDetailsTest, CreateForPromptLocalStorage) {
@@ -218,6 +224,7 @@ TEST_F(CookiesDetailsTest, CreateForPromptLocalStorage) {
EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]);
EXPECT_FALSE([details.get() shouldShowAppCachePromptDetailsView]);
EXPECT_FALSE([details.get() shouldShowServiceWorkerTreeDetailsView]);
+ EXPECT_FALSE([details.get() shouldShowCacheStorageTreeDetailsView]);
}
TEST_F(CookiesDetailsTest, CreateForPromptAppCache) {
@@ -239,6 +246,7 @@ TEST_F(CookiesDetailsTest, CreateForPromptAppCache) {
EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]);
EXPECT_TRUE([details.get() shouldShowAppCachePromptDetailsView]);
EXPECT_FALSE([details.get() shouldShowServiceWorkerTreeDetailsView]);
+ EXPECT_FALSE([details.get() shouldShowCacheStorageTreeDetailsView]);
}
TEST_F(CookiesDetailsTest, CreateForTreeServiceWorker) {
@@ -270,5 +278,34 @@ TEST_F(CookiesDetailsTest, CreateForTreeServiceWorker) {
EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]);
EXPECT_FALSE([details.get() shouldShowAppCachePromptDetailsView]);
EXPECT_TRUE([details.get() shouldShowServiceWorkerTreeDetailsView]);
+ EXPECT_FALSE([details.get() shouldShowCacheStorageTreeDetailsView]);
+}
+
+TEST_F(CookiesDetailsTest, CreateForTreeCacheStorage) {
+ base::scoped_nsobject<CocoaCookieDetails> details;
+
+ GURL origin("https://example.com/");
+ int64 size = 1234;
+ base::Time last_modified = base::Time::Now();
+ content::CacheStorageUsageInfo info(origin, size, last_modified);
+
+ details.reset(
+ [[CocoaCookieDetails alloc] initWithCacheStorageUsageInfo:&info]);
+
+ EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypeTreeCacheStorage);
+ EXPECT_NSEQ(@"https://example.com/", [details.get() domain]);
+ EXPECT_NSEQ(@"1,234 B", [details.get() fileSize]);
+ EXPECT_NSNE(@"", [details.get() lastModified]);
+
+ EXPECT_TRUE([details.get() shouldHideCookieDetailsView]);
+ EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]);
+ EXPECT_FALSE([details.get() shouldShowDatabaseTreeDetailsView]);
+ EXPECT_FALSE([details.get() shouldShowAppCacheTreeDetailsView]);
+ EXPECT_FALSE([details.get() shouldShowIndexedDBTreeDetailsView]);
+ EXPECT_FALSE([details.get() shouldShowLocalStoragePromptDetailsView]);
+ EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]);
+ EXPECT_FALSE([details.get() shouldShowAppCachePromptDetailsView]);
+ EXPECT_FALSE([details.get() shouldShowServiceWorkerTreeDetailsView]);
+ EXPECT_TRUE([details.get() shouldShowCacheStorageTreeDetailsView]);
}
}
« no previous file with comments | « chrome/browser/ui/cocoa/content_settings/cookie_details.mm ('k') | chrome/browser/ui/webui/cookies_tree_model_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698