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]); |
} |
} |