| 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 "googleurl/src/gurl.h" | 8 #include "googleurl/src/gurl.h" |
| 9 #include "net/cookies/canonical_cookie.h" | 9 #include "net/cookies/canonical_cookie.h" |
| 10 #include "net/cookies/parsed_cookie.h" | 10 #include "net/cookies/parsed_cookie.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 EXPECT_FALSE([details.get() shouldShowDatabaseTreeDetailsView]); | 47 EXPECT_FALSE([details.get() shouldShowDatabaseTreeDetailsView]); |
| 48 EXPECT_FALSE([details.get() shouldShowAppCacheTreeDetailsView]); | 48 EXPECT_FALSE([details.get() shouldShowAppCacheTreeDetailsView]); |
| 49 EXPECT_FALSE([details.get() shouldShowIndexedDBTreeDetailsView]); | 49 EXPECT_FALSE([details.get() shouldShowIndexedDBTreeDetailsView]); |
| 50 EXPECT_FALSE([details.get() shouldShowLocalStoragePromptDetailsView]); | 50 EXPECT_FALSE([details.get() shouldShowLocalStoragePromptDetailsView]); |
| 51 EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]); | 51 EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]); |
| 52 EXPECT_FALSE([details.get() shouldShowAppCachePromptDetailsView]); | 52 EXPECT_FALSE([details.get() shouldShowAppCachePromptDetailsView]); |
| 53 } | 53 } |
| 54 | 54 |
| 55 TEST_F(CookiesDetailsTest, CreateForTreeDatabase) { | 55 TEST_F(CookiesDetailsTest, CreateForTreeDatabase) { |
| 56 scoped_nsobject<CocoaCookieDetails> details; | 56 scoped_nsobject<CocoaCookieDetails> details; |
| 57 std::string host("http://chromium.org"); | 57 GURL origin("http://chromium.org"); |
| 58 std::string database_name("sassolungo"); | 58 std::string database_name("sassolungo"); |
| 59 std::string origin_identifier("dolomites"); | |
| 60 std::string description("a great place to climb"); | 59 std::string description("a great place to climb"); |
| 61 int64 size = 1234; | 60 int64 size = 1234; |
| 62 base::Time last_modified = base::Time::Now(); | 61 base::Time last_modified = base::Time::Now(); |
| 63 BrowsingDataDatabaseHelper::DatabaseInfo info(host, database_name, | 62 BrowsingDataDatabaseHelper::DatabaseInfo info( |
| 64 origin_identifier, description, host, size, last_modified); | 63 webkit_database::DatabaseIdentifier::CreateFromOrigin(origin), |
| 64 database_name, description, size, last_modified); |
| 65 details.reset([[CocoaCookieDetails alloc] initWithDatabase:&info]); | 65 details.reset([[CocoaCookieDetails alloc] initWithDatabase:&info]); |
| 66 | 66 |
| 67 EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypeTreeDatabase); | 67 EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypeTreeDatabase); |
| 68 EXPECT_NSEQ(@"a great place to climb", [details.get() databaseDescription]); | 68 EXPECT_NSEQ(@"a great place to climb", [details.get() databaseDescription]); |
| 69 EXPECT_NSEQ(@"1,234 B", [details.get() fileSize]); | 69 EXPECT_NSEQ(@"1,234 B", [details.get() fileSize]); |
| 70 EXPECT_NSNE(@"", [details.get() lastModified]); | 70 EXPECT_NSNE(@"", [details.get() lastModified]); |
| 71 | 71 |
| 72 EXPECT_TRUE([details.get() shouldHideCookieDetailsView]); | 72 EXPECT_TRUE([details.get() shouldHideCookieDetailsView]); |
| 73 EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]); | 73 EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]); |
| 74 EXPECT_TRUE([details.get() shouldShowDatabaseTreeDetailsView]); | 74 EXPECT_TRUE([details.get() shouldShowDatabaseTreeDetailsView]); |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]); | 225 EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]); |
| 226 EXPECT_FALSE([details.get() shouldShowDatabaseTreeDetailsView]); | 226 EXPECT_FALSE([details.get() shouldShowDatabaseTreeDetailsView]); |
| 227 EXPECT_FALSE([details.get() shouldShowAppCacheTreeDetailsView]); | 227 EXPECT_FALSE([details.get() shouldShowAppCacheTreeDetailsView]); |
| 228 EXPECT_FALSE([details.get() shouldShowIndexedDBTreeDetailsView]); | 228 EXPECT_FALSE([details.get() shouldShowIndexedDBTreeDetailsView]); |
| 229 EXPECT_FALSE([details.get() shouldShowLocalStoragePromptDetailsView]); | 229 EXPECT_FALSE([details.get() shouldShowLocalStoragePromptDetailsView]); |
| 230 EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]); | 230 EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]); |
| 231 EXPECT_TRUE([details.get() shouldShowAppCachePromptDetailsView]); | 231 EXPECT_TRUE([details.get() shouldShowAppCachePromptDetailsView]); |
| 232 } | 232 } |
| 233 | 233 |
| 234 } | 234 } |
| OLD | NEW |