OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/cocoa/cocoa_test_helper.h" | 6 #import "chrome/browser/cocoa/cocoa_test_helper.h" |
7 #include "chrome/browser/cocoa/cookie_details.h" | 7 #include "chrome/browser/cocoa/cookie_details.h" |
8 #include "googleurl/src/gurl.h" | 8 #include "googleurl/src/gurl.h" |
9 | 9 |
10 namespace { | 10 namespace { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 TEST_F(CookiesDetailsTest, CreateForTreeDatabase) { | 53 TEST_F(CookiesDetailsTest, CreateForTreeDatabase) { |
54 scoped_nsobject<CocoaCookieDetails> details; | 54 scoped_nsobject<CocoaCookieDetails> details; |
55 std::string host("http://chromium.org"); | 55 std::string host("http://chromium.org"); |
56 std::string database_name("sassolungo"); | 56 std::string database_name("sassolungo"); |
57 std::string origin_identifier("dolomites"); | 57 std::string origin_identifier("dolomites"); |
58 std::string description("a great place to climb"); | 58 std::string description("a great place to climb"); |
59 int64 size = 1234; | 59 int64 size = 1234; |
60 base::Time last_modified = base::Time::Now(); | 60 base::Time last_modified = base::Time::Now(); |
61 BrowsingDataDatabaseHelper::DatabaseInfo info(host, database_name, | 61 BrowsingDataDatabaseHelper::DatabaseInfo info(host, database_name, |
62 origin_identifier, description, size, last_modified); | 62 origin_identifier, description, host, size, last_modified); |
63 details.reset([[CocoaCookieDetails alloc] initWithDatabase:&info]); | 63 details.reset([[CocoaCookieDetails alloc] initWithDatabase:&info]); |
64 | 64 |
65 EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypeTreeDatabase); | 65 EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypeTreeDatabase); |
66 EXPECT_TRUE([@"a great place to climb" isEqualToString:[details.get() | 66 EXPECT_TRUE([@"a great place to climb" isEqualToString:[details.get() |
67 databaseDescription]]); | 67 databaseDescription]]); |
68 EXPECT_TRUE([@"1234 B" isEqualToString:[details.get() fileSize]]); | 68 EXPECT_TRUE([@"1234 B" isEqualToString:[details.get() fileSize]]); |
69 EXPECT_FALSE([@"" isEqualToString:[details.get() lastModified]]); | 69 EXPECT_FALSE([@"" isEqualToString:[details.get() lastModified]]); |
70 | 70 |
71 EXPECT_TRUE([details.get() shouldHideCookieDetailsView]); | 71 EXPECT_TRUE([details.get() shouldHideCookieDetailsView]); |
72 EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]); | 72 EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 EXPECT_TRUE([details.get() shouldHideCookieDetailsView]); | 194 EXPECT_TRUE([details.get() shouldHideCookieDetailsView]); |
195 EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]); | 195 EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]); |
196 EXPECT_FALSE([details.get() shouldShowDatabaseTreeDetailsView]); | 196 EXPECT_FALSE([details.get() shouldShowDatabaseTreeDetailsView]); |
197 EXPECT_FALSE([details.get() shouldShowAppCacheTreeDetailsView]); | 197 EXPECT_FALSE([details.get() shouldShowAppCacheTreeDetailsView]); |
198 EXPECT_FALSE([details.get() shouldShowLocalStoragePromptDetailsView]); | 198 EXPECT_FALSE([details.get() shouldShowLocalStoragePromptDetailsView]); |
199 EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]); | 199 EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]); |
200 EXPECT_TRUE([details.get() shouldShowAppCachePromptDetailsView]); | 200 EXPECT_TRUE([details.get() shouldShowAppCachePromptDetailsView]); |
201 } | 201 } |
202 | 202 |
203 } | 203 } |
OLD | NEW |