Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: chrome/browser/ui/cocoa/content_settings/cookie_details_unittest.mm

Issue 10709006: Show apps protecting local data in chrome://settings/cookies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: argh Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/sys_string_conversions.h" 5 #include "base/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/parsed_cookie.h" 9 #include "net/cookies/parsed_cookie.h"
10 #import "testing/gtest_mac.h" 10 #import "testing/gtest_mac.h"
(...skipping 10 matching lines...) Expand all
21 EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypeFolder); 21 EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypeFolder);
22 } 22 }
23 23
24 TEST_F(CookiesDetailsTest, CreateForCookie) { 24 TEST_F(CookiesDetailsTest, CreateForCookie) {
25 scoped_nsobject<CocoaCookieDetails> details; 25 scoped_nsobject<CocoaCookieDetails> details;
26 GURL url("http://chromium.org"); 26 GURL url("http://chromium.org");
27 std::string cookieLine( 27 std::string cookieLine(
28 "PHPSESSID=0123456789abcdef0123456789abcdef; path=/"); 28 "PHPSESSID=0123456789abcdef0123456789abcdef; path=/");
29 net::ParsedCookie pc(cookieLine); 29 net::ParsedCookie pc(cookieLine);
30 net::CookieMonster::CanonicalCookie cookie(url, pc); 30 net::CookieMonster::CanonicalCookie cookie(url, pc);
31 NSString* origin = base::SysUTF8ToNSString("http://chromium.org");
32 details.reset([[CocoaCookieDetails alloc] initWithCookie:&cookie 31 details.reset([[CocoaCookieDetails alloc] initWithCookie:&cookie
33 origin:origin
34 canEditExpiration:NO]); 32 canEditExpiration:NO]);
35 33
36 EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypeCookie); 34 EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypeCookie);
37 EXPECT_NSEQ(@"PHPSESSID", [details.get() name]); 35 EXPECT_NSEQ(@"PHPSESSID", [details.get() name]);
38 EXPECT_NSEQ(@"0123456789abcdef0123456789abcdef", 36 EXPECT_NSEQ(@"0123456789abcdef0123456789abcdef",
39 [details.get() content]); 37 [details.get() content]);
40 EXPECT_NSEQ(@"http://chromium.org", [details.get() domain]); 38 EXPECT_NSEQ(@"chromium.org", [details.get() domain]);
41 EXPECT_NSEQ(@"/", [details.get() path]); 39 EXPECT_NSEQ(@"/", [details.get() path]);
42 EXPECT_NSNE(@"", [details.get() lastModified]); 40 EXPECT_NSNE(@"", [details.get() lastModified]);
43 EXPECT_NSNE(@"", [details.get() created]); 41 EXPECT_NSNE(@"", [details.get() created]);
44 EXPECT_NSNE(@"", [details.get() sendFor]); 42 EXPECT_NSNE(@"", [details.get() sendFor]);
45 43
46 EXPECT_FALSE([details.get() shouldHideCookieDetailsView]); 44 EXPECT_FALSE([details.get() shouldHideCookieDetailsView]);
47 EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]); 45 EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]);
48 EXPECT_FALSE([details.get() shouldShowDatabaseTreeDetailsView]); 46 EXPECT_FALSE([details.get() shouldShowDatabaseTreeDetailsView]);
49 EXPECT_FALSE([details.get() shouldShowAppCacheTreeDetailsView]); 47 EXPECT_FALSE([details.get() shouldShowAppCacheTreeDetailsView]);
50 EXPECT_FALSE([details.get() shouldShowIndexedDBTreeDetailsView]); 48 EXPECT_FALSE([details.get() shouldShowIndexedDBTreeDetailsView]);
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]); 222 EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]);
225 EXPECT_FALSE([details.get() shouldShowDatabaseTreeDetailsView]); 223 EXPECT_FALSE([details.get() shouldShowDatabaseTreeDetailsView]);
226 EXPECT_FALSE([details.get() shouldShowAppCacheTreeDetailsView]); 224 EXPECT_FALSE([details.get() shouldShowAppCacheTreeDetailsView]);
227 EXPECT_FALSE([details.get() shouldShowIndexedDBTreeDetailsView]); 225 EXPECT_FALSE([details.get() shouldShowIndexedDBTreeDetailsView]);
228 EXPECT_FALSE([details.get() shouldShowLocalStoragePromptDetailsView]); 226 EXPECT_FALSE([details.get() shouldShowLocalStoragePromptDetailsView]);
229 EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]); 227 EXPECT_FALSE([details.get() shouldShowDatabasePromptDetailsView]);
230 EXPECT_TRUE([details.get() shouldShowAppCachePromptDetailsView]); 228 EXPECT_TRUE([details.get() shouldShowAppCachePromptDetailsView]);
231 } 229 }
232 230
233 } 231 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698