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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 } | 54 } |
55 | 55 |
56 TEST_F(CookiesDetailsTest, CreateForTreeDatabase) { | 56 TEST_F(CookiesDetailsTest, CreateForTreeDatabase) { |
57 base::scoped_nsobject<CocoaCookieDetails> details; | 57 base::scoped_nsobject<CocoaCookieDetails> details; |
58 GURL origin("http://chromium.org"); | 58 GURL origin("http://chromium.org"); |
59 std::string database_name("sassolungo"); | 59 std::string database_name("sassolungo"); |
60 std::string description("a great place to climb"); | 60 std::string description("a great place to climb"); |
61 int64 size = 1234; | 61 int64 size = 1234; |
62 base::Time last_modified = base::Time::Now(); | 62 base::Time last_modified = base::Time::Now(); |
63 BrowsingDataDatabaseHelper::DatabaseInfo info( | 63 BrowsingDataDatabaseHelper::DatabaseInfo info( |
64 webkit_database::DatabaseIdentifier::CreateFromOrigin(origin), | 64 storage::DatabaseIdentifier::CreateFromOrigin(origin), |
65 database_name, description, size, last_modified); | 65 database_name, |
| 66 description, |
| 67 size, |
| 68 last_modified); |
66 details.reset([[CocoaCookieDetails alloc] initWithDatabase:&info]); | 69 details.reset([[CocoaCookieDetails alloc] initWithDatabase:&info]); |
67 | 70 |
68 EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypeTreeDatabase); | 71 EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypeTreeDatabase); |
69 EXPECT_NSEQ(@"a great place to climb", [details.get() databaseDescription]); | 72 EXPECT_NSEQ(@"a great place to climb", [details.get() databaseDescription]); |
70 EXPECT_NSEQ(@"1,234 B", [details.get() fileSize]); | 73 EXPECT_NSEQ(@"1,234 B", [details.get() fileSize]); |
71 EXPECT_NSNE(@"", [details.get() lastModified]); | 74 EXPECT_NSNE(@"", [details.get() lastModified]); |
72 | 75 |
73 EXPECT_TRUE([details.get() shouldHideCookieDetailsView]); | 76 EXPECT_TRUE([details.get() shouldHideCookieDetailsView]); |
74 EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]); | 77 EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]); |
75 EXPECT_TRUE([details.get() shouldShowDatabaseTreeDetailsView]); | 78 EXPECT_TRUE([details.get() shouldShowDatabaseTreeDetailsView]); |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]); | 267 EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]); |
265 EXPECT_FALSE([details.get() shouldShowDatabaseTreeDetailsView]); | 268 EXPECT_FALSE([details.get() shouldShowDatabaseTreeDetailsView]); |
266 EXPECT_FALSE([details.get() shouldShowAppCacheTreeDetailsView]); | 269 EXPECT_FALSE([details.get() shouldShowAppCacheTreeDetailsView]); |
267 EXPECT_FALSE([details.get() shouldShowIndexedDBTreeDetailsView]); | 270 EXPECT_FALSE([details.get() shouldShowIndexedDBTreeDetailsView]); |
268 EXPECT_FALSE([details.get() shouldShowLocalStoragePromptDetailsView]); | 271 EXPECT_FALSE([details.get() shouldShowLocalStoragePromptDetailsView]); |
269 EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]); | 272 EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]); |
270 EXPECT_FALSE([details.get() shouldShowAppCachePromptDetailsView]); | 273 EXPECT_FALSE([details.get() shouldShowAppCachePromptDetailsView]); |
271 EXPECT_TRUE([details.get() shouldShowServiceWorkerTreeDetailsView]); | 274 EXPECT_TRUE([details.get() shouldShowServiceWorkerTreeDetailsView]); |
272 } | 275 } |
273 } | 276 } |
OLD | NEW |