summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/cookie_details_unittest.mm
diff options
context:
space:
mode:
authorbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-24 15:32:42 +0000
committerbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-24 15:32:42 +0000
commit3cc47d6ba4dd8f5522e0b1939c3906742d964d94 (patch)
tree07b371fb4d1c5079a826e159756d63b0451a034b /chrome/browser/cocoa/cookie_details_unittest.mm
parent6cb60aa4474b7bd3680f5ce36aaf08bf0484dbea (diff)
downloadchromium_src-3cc47d6ba4dd8f5522e0b1939c3906742d964d94.zip
chromium_src-3cc47d6ba4dd8f5522e0b1939c3906742d964d94.tar.gz
chromium_src-3cc47d6ba4dd8f5522e0b1939c3906742d964d94.tar.bz2
Add IndexedDB to cookie tree.
XIB changes: Add another view with IndexedDB details to CookieDetailsView.xib. BUG=56248 TEST=CookiesTreeModelTest.*:CookiesDetailsTest.*:CookiesViewTest.*: Review URL: http://codereview.chromium.org/3429020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60470 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/cookie_details_unittest.mm')
-rw-r--r--chrome/browser/cocoa/cookie_details_unittest.mm48
1 files changed, 47 insertions, 1 deletions
diff --git a/chrome/browser/cocoa/cookie_details_unittest.mm b/chrome/browser/cocoa/cookie_details_unittest.mm
index fa79c31..897d92a 100644
--- a/chrome/browser/cocoa/cookie_details_unittest.mm
+++ b/chrome/browser/cocoa/cookie_details_unittest.mm
@@ -46,6 +46,7 @@ TEST_F(CookiesDetailsTest, CreateForCookie) {
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]);
@@ -72,6 +73,7 @@ TEST_F(CookiesDetailsTest, CreateForTreeDatabase) {
EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]);
EXPECT_TRUE([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]);
@@ -84,7 +86,7 @@ TEST_F(CookiesDetailsTest, CreateForTreeLocalStorage) {
unsigned short port = 80;
std::string database_identifier("id");
std::string origin("chromium.org");
- FilePath file_path(FilePath::FromWStringHack(std::wstring(L"/")));
+ FilePath file_path(FILE_PATH_LITERAL("/"));
int64 size = 1234;
base::Time last_modified = base::Time::Now();
BrowsingDataLocalStorageHelper::LocalStorageInfo info(protocol, host, port,
@@ -100,6 +102,7 @@ TEST_F(CookiesDetailsTest, CreateForTreeLocalStorage) {
EXPECT_TRUE([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]);
@@ -128,6 +131,46 @@ TEST_F(CookiesDetailsTest, CreateForTreeAppCache) {
EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]);
EXPECT_FALSE([details.get() shouldShowDatabaseTreeDetailsView]);
EXPECT_TRUE([details.get() shouldShowAppCacheTreeDetailsView]);
+ EXPECT_FALSE([details.get() shouldShowIndexedDBTreeDetailsView]);
+ EXPECT_FALSE([details.get() shouldShowLocalStoragePromptDetailsView]);
+ EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]);
+ EXPECT_FALSE([details.get() shouldShowAppCachePromptDetailsView]);
+}
+
+TEST_F(CookiesDetailsTest, CreateForTreeIndexedDB) {
+ scoped_nsobject<CocoaCookieDetails> details;
+
+ std::string protocol("http");
+ std::string host("moose.org");
+ unsigned short port = 80;
+ std::string database_identifier("id");
+ std::string origin("moose.org");
+ std::string name("name");
+ FilePath file_path(FILE_PATH_LITERAL("/"));
+ int64 size = 1234;
+ base::Time last_modified = base::Time::Now();
+ BrowsingDataIndexedDBHelper::IndexedDBInfo info(protocol,
+ host,
+ port,
+ database_identifier,
+ origin,
+ name,
+ file_path,
+ size,
+ last_modified);
+
+ details.reset([[CocoaCookieDetails alloc] initWithIndexedDBInfo:&info]);
+
+ EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypeTreeIndexedDB);
+ EXPECT_NSEQ(@"moose.org", [details.get() domain]);
+ EXPECT_NSEQ(@"1234 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_TRUE([details.get() shouldShowIndexedDBTreeDetailsView]);
EXPECT_FALSE([details.get() shouldShowLocalStoragePromptDetailsView]);
EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]);
EXPECT_FALSE([details.get() shouldShowAppCachePromptDetailsView]);
@@ -153,6 +196,7 @@ TEST_F(CookiesDetailsTest, CreateForPromptDatabase) {
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_TRUE([details.get() shouldShowDatabasePromptDetailsView]);
EXPECT_FALSE([details.get() shouldShowAppCachePromptDetailsView]);
@@ -176,6 +220,7 @@ TEST_F(CookiesDetailsTest, CreateForPromptLocalStorage) {
EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]);
EXPECT_FALSE([details.get() shouldShowDatabaseTreeDetailsView]);
EXPECT_FALSE([details.get() shouldShowAppCacheTreeDetailsView]);
+ EXPECT_FALSE([details.get() shouldShowIndexedDBTreeDetailsView]);
EXPECT_TRUE([details.get() shouldShowLocalStoragePromptDetailsView]);
EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]);
EXPECT_FALSE([details.get() shouldShowAppCachePromptDetailsView]);
@@ -195,6 +240,7 @@ TEST_F(CookiesDetailsTest, CreateForPromptAppCache) {
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_TRUE([details.get() shouldShowAppCachePromptDetailsView]);