OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/strings/sys_string_conversions.h" | 5 #include "base/strings/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 "net/cookies/canonical_cookie.h" | 8 #include "net/cookies/canonical_cookie.h" |
9 #include "net/cookies/parsed_cookie.h" | 9 #include "net/cookies/parsed_cookie.h" |
10 #import "testing/gtest_mac.h" | 10 #import "testing/gtest_mac.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 EXPECT_FALSE([details.get() shouldShowAppCachePromptDetailsView]); | 138 EXPECT_FALSE([details.get() shouldShowAppCachePromptDetailsView]); |
139 EXPECT_FALSE([details.get() shouldShowServiceWorkerTreeDetailsView]); | 139 EXPECT_FALSE([details.get() shouldShowServiceWorkerTreeDetailsView]); |
140 } | 140 } |
141 | 141 |
142 TEST_F(CookiesDetailsTest, CreateForTreeIndexedDB) { | 142 TEST_F(CookiesDetailsTest, CreateForTreeIndexedDB) { |
143 base::scoped_nsobject<CocoaCookieDetails> details; | 143 base::scoped_nsobject<CocoaCookieDetails> details; |
144 | 144 |
145 GURL origin("http://moose.org/"); | 145 GURL origin("http://moose.org/"); |
146 int64 size = 1234; | 146 int64 size = 1234; |
147 base::Time last_modified = base::Time::Now(); | 147 base::Time last_modified = base::Time::Now(); |
148 base::FilePath file_path; | |
149 content::IndexedDBInfo info(origin, | 148 content::IndexedDBInfo info(origin, |
150 size, | 149 size, |
151 last_modified, | 150 last_modified, |
152 file_path, | |
153 0); | 151 0); |
154 | 152 |
155 details.reset([[CocoaCookieDetails alloc] initWithIndexedDBInfo:&info]); | 153 details.reset([[CocoaCookieDetails alloc] initWithIndexedDBInfo:&info]); |
156 | 154 |
157 EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypeTreeIndexedDB); | 155 EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypeTreeIndexedDB); |
158 EXPECT_NSEQ(@"http://moose.org/", [details.get() domain]); | 156 EXPECT_NSEQ(@"http://moose.org/", [details.get() domain]); |
159 EXPECT_NSEQ(@"1,234 B", [details.get() fileSize]); | 157 EXPECT_NSEQ(@"1,234 B", [details.get() fileSize]); |
160 EXPECT_NSNE(@"", [details.get() lastModified]); | 158 EXPECT_NSNE(@"", [details.get() lastModified]); |
161 | 159 |
162 EXPECT_TRUE([details.get() shouldHideCookieDetailsView]); | 160 EXPECT_TRUE([details.get() shouldHideCookieDetailsView]); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]); | 265 EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]); |
268 EXPECT_FALSE([details.get() shouldShowDatabaseTreeDetailsView]); | 266 EXPECT_FALSE([details.get() shouldShowDatabaseTreeDetailsView]); |
269 EXPECT_FALSE([details.get() shouldShowAppCacheTreeDetailsView]); | 267 EXPECT_FALSE([details.get() shouldShowAppCacheTreeDetailsView]); |
270 EXPECT_FALSE([details.get() shouldShowIndexedDBTreeDetailsView]); | 268 EXPECT_FALSE([details.get() shouldShowIndexedDBTreeDetailsView]); |
271 EXPECT_FALSE([details.get() shouldShowLocalStoragePromptDetailsView]); | 269 EXPECT_FALSE([details.get() shouldShowLocalStoragePromptDetailsView]); |
272 EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]); | 270 EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]); |
273 EXPECT_FALSE([details.get() shouldShowAppCachePromptDetailsView]); | 271 EXPECT_FALSE([details.get() shouldShowAppCachePromptDetailsView]); |
274 EXPECT_TRUE([details.get() shouldShowServiceWorkerTreeDetailsView]); | 272 EXPECT_TRUE([details.get() shouldShowServiceWorkerTreeDetailsView]); |
275 } | 273 } |
276 } | 274 } |
OLD | NEW |