| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 #include "base/strings/sys_string_conversions.h" | 6 #include "base/strings/sys_string_conversions.h" |
| 7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
| 8 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 8 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
| 9 | 9 |
| 10 #include "chrome/browser/ui/cocoa/content_settings/cookie_details.h" | 10 #include "chrome/browser/ui/cocoa/content_settings/cookie_details.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 details.reset([[CocoaCookieDetails alloc] initAsFolder]); | 23 details.reset([[CocoaCookieDetails alloc] initAsFolder]); |
| 24 | 24 |
| 25 EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypeFolder); | 25 EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypeFolder); |
| 26 } | 26 } |
| 27 | 27 |
| 28 TEST_F(CookiesDetailsTest, CreateForCookie) { | 28 TEST_F(CookiesDetailsTest, CreateForCookie) { |
| 29 base::scoped_nsobject<CocoaCookieDetails> details; | 29 base::scoped_nsobject<CocoaCookieDetails> details; |
| 30 GURL url("http://chromium.org"); | 30 GURL url("http://chromium.org"); |
| 31 std::string cookieLine( | 31 std::string cookieLine( |
| 32 "PHPSESSID=0123456789abcdef0123456789abcdef; path=/"); | 32 "PHPSESSID=0123456789abcdef0123456789abcdef; path=/"); |
| 33 scoped_ptr<net::CanonicalCookie> cookie(net::CanonicalCookie::Create( | 33 std::unique_ptr<net::CanonicalCookie> cookie(net::CanonicalCookie::Create( |
| 34 url, cookieLine, base::Time::Now(), net::CookieOptions())); | 34 url, cookieLine, base::Time::Now(), net::CookieOptions())); |
| 35 details.reset([[CocoaCookieDetails alloc] initWithCookie:cookie.get() | 35 details.reset([[CocoaCookieDetails alloc] initWithCookie:cookie.get() |
| 36 canEditExpiration:NO]); | 36 canEditExpiration:NO]); |
| 37 | 37 |
| 38 EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypeCookie); | 38 EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypeCookie); |
| 39 EXPECT_NSEQ(@"PHPSESSID", [details.get() name]); | 39 EXPECT_NSEQ(@"PHPSESSID", [details.get() name]); |
| 40 EXPECT_NSEQ(@"0123456789abcdef0123456789abcdef", | 40 EXPECT_NSEQ(@"0123456789abcdef0123456789abcdef", |
| 41 [details.get() content]); | 41 [details.get() content]); |
| 42 EXPECT_NSEQ(@"chromium.org", [details.get() domain]); | 42 EXPECT_NSEQ(@"chromium.org", [details.get() domain]); |
| 43 EXPECT_NSEQ(@"/", [details.get() path]); | 43 EXPECT_NSEQ(@"/", [details.get() path]); |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 EXPECT_FALSE([details.get() shouldShowDatabaseTreeDetailsView]); | 305 EXPECT_FALSE([details.get() shouldShowDatabaseTreeDetailsView]); |
| 306 EXPECT_FALSE([details.get() shouldShowAppCacheTreeDetailsView]); | 306 EXPECT_FALSE([details.get() shouldShowAppCacheTreeDetailsView]); |
| 307 EXPECT_FALSE([details.get() shouldShowIndexedDBTreeDetailsView]); | 307 EXPECT_FALSE([details.get() shouldShowIndexedDBTreeDetailsView]); |
| 308 EXPECT_FALSE([details.get() shouldShowLocalStoragePromptDetailsView]); | 308 EXPECT_FALSE([details.get() shouldShowLocalStoragePromptDetailsView]); |
| 309 EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]); | 309 EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]); |
| 310 EXPECT_FALSE([details.get() shouldShowAppCachePromptDetailsView]); | 310 EXPECT_FALSE([details.get() shouldShowAppCachePromptDetailsView]); |
| 311 EXPECT_FALSE([details.get() shouldShowServiceWorkerTreeDetailsView]); | 311 EXPECT_FALSE([details.get() shouldShowServiceWorkerTreeDetailsView]); |
| 312 EXPECT_TRUE([details.get() shouldShowCacheStorageTreeDetailsView]); | 312 EXPECT_TRUE([details.get() shouldShowCacheStorageTreeDetailsView]); |
| 313 } | 313 } |
| 314 } | 314 } |
| OLD | NEW |