| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/sys_string_conversions.h" | 5 #include "base/sys_string_conversions.h" |
| 6 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 6 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
| 7 #include "chrome/browser/ui/cocoa/content_settings/cookie_details.h" | 7 #include "chrome/browser/ui/cocoa/content_settings/cookie_details.h" |
| 8 #include "googleurl/src/gurl.h" | 8 #include "googleurl/src/gurl.h" |
| 9 #import "testing/gtest_mac.h" | 9 #import "testing/gtest_mac.h" |
| 10 | 10 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 EXPECT_TRUE([details.get() shouldShowAppCacheTreeDetailsView]); | 133 EXPECT_TRUE([details.get() shouldShowAppCacheTreeDetailsView]); |
| 134 EXPECT_FALSE([details.get() shouldShowIndexedDBTreeDetailsView]); | 134 EXPECT_FALSE([details.get() shouldShowIndexedDBTreeDetailsView]); |
| 135 EXPECT_FALSE([details.get() shouldShowLocalStoragePromptDetailsView]); | 135 EXPECT_FALSE([details.get() shouldShowLocalStoragePromptDetailsView]); |
| 136 EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]); | 136 EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]); |
| 137 EXPECT_FALSE([details.get() shouldShowAppCachePromptDetailsView]); | 137 EXPECT_FALSE([details.get() shouldShowAppCachePromptDetailsView]); |
| 138 } | 138 } |
| 139 | 139 |
| 140 TEST_F(CookiesDetailsTest, CreateForTreeIndexedDB) { | 140 TEST_F(CookiesDetailsTest, CreateForTreeIndexedDB) { |
| 141 scoped_nsobject<CocoaCookieDetails> details; | 141 scoped_nsobject<CocoaCookieDetails> details; |
| 142 | 142 |
| 143 std::string protocol("http"); | 143 GURL origin("http://moose.org/"); |
| 144 std::string host("moose.org"); | |
| 145 unsigned short port = 80; | |
| 146 std::string database_identifier("id"); | |
| 147 std::string origin("moose.org"); | |
| 148 FilePath file_path(FILE_PATH_LITERAL("/")); | |
| 149 int64 size = 1234; | 144 int64 size = 1234; |
| 150 base::Time last_modified = base::Time::Now(); | 145 base::Time last_modified = base::Time::Now(); |
| 151 BrowsingDataIndexedDBHelper::IndexedDBInfo info(protocol, | 146 BrowsingDataIndexedDBHelper::IndexedDBInfo info(origin, |
| 152 host, | |
| 153 port, | |
| 154 database_identifier, | |
| 155 origin, | |
| 156 file_path, | |
| 157 size, | 147 size, |
| 158 last_modified); | 148 last_modified); |
| 159 | 149 |
| 160 details.reset([[CocoaCookieDetails alloc] initWithIndexedDBInfo:&info]); | 150 details.reset([[CocoaCookieDetails alloc] initWithIndexedDBInfo:&info]); |
| 161 | 151 |
| 162 EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypeTreeIndexedDB); | 152 EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypeTreeIndexedDB); |
| 163 EXPECT_NSEQ(@"moose.org", [details.get() domain]); | 153 EXPECT_NSEQ(@"http://moose.org/", [details.get() domain]); |
| 164 EXPECT_NSEQ(@"1,234 B", [details.get() fileSize]); | 154 EXPECT_NSEQ(@"1,234 B", [details.get() fileSize]); |
| 165 EXPECT_NSNE(@"", [details.get() lastModified]); | 155 EXPECT_NSNE(@"", [details.get() lastModified]); |
| 166 | 156 |
| 167 EXPECT_TRUE([details.get() shouldHideCookieDetailsView]); | 157 EXPECT_TRUE([details.get() shouldHideCookieDetailsView]); |
| 168 EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]); | 158 EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]); |
| 169 EXPECT_FALSE([details.get() shouldShowDatabaseTreeDetailsView]); | 159 EXPECT_FALSE([details.get() shouldShowDatabaseTreeDetailsView]); |
| 170 EXPECT_FALSE([details.get() shouldShowAppCacheTreeDetailsView]); | 160 EXPECT_FALSE([details.get() shouldShowAppCacheTreeDetailsView]); |
| 171 EXPECT_TRUE([details.get() shouldShowIndexedDBTreeDetailsView]); | 161 EXPECT_TRUE([details.get() shouldShowIndexedDBTreeDetailsView]); |
| 172 EXPECT_FALSE([details.get() shouldShowLocalStoragePromptDetailsView]); | 162 EXPECT_FALSE([details.get() shouldShowLocalStoragePromptDetailsView]); |
| 173 EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]); | 163 EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]); | 228 EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]); |
| 239 EXPECT_FALSE([details.get() shouldShowDatabaseTreeDetailsView]); | 229 EXPECT_FALSE([details.get() shouldShowDatabaseTreeDetailsView]); |
| 240 EXPECT_FALSE([details.get() shouldShowAppCacheTreeDetailsView]); | 230 EXPECT_FALSE([details.get() shouldShowAppCacheTreeDetailsView]); |
| 241 EXPECT_FALSE([details.get() shouldShowIndexedDBTreeDetailsView]); | 231 EXPECT_FALSE([details.get() shouldShowIndexedDBTreeDetailsView]); |
| 242 EXPECT_FALSE([details.get() shouldShowLocalStoragePromptDetailsView]); | 232 EXPECT_FALSE([details.get() shouldShowLocalStoragePromptDetailsView]); |
| 243 EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]); | 233 EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]); |
| 244 EXPECT_TRUE([details.get() shouldShowAppCachePromptDetailsView]); | 234 EXPECT_TRUE([details.get() shouldShowAppCachePromptDetailsView]); |
| 245 } | 235 } |
| 246 | 236 |
| 247 } | 237 } |
| OLD | NEW |