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

Side by Side Diff: chrome/browser/extensions/extension_cookies_unittest.cc

Issue 5742011: Do not create an incognito profile if none exists in cookies.getAllCookieStores (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/browser/extensions
Patch Set: Created 10 years 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) 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 // Tests common functionality used by the Chrome Extensions Cookies API 5 // Tests common functionality used by the Chrome Extensions Cookies API
6 // implementation. 6 // implementation.
7 7
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 24 matching lines...) Expand all
35 return this; 35 return this;
36 } 36 }
37 37
38 virtual Profile* GetOffTheRecordProfile() { 38 virtual Profile* GetOffTheRecordProfile() {
39 if (IsOffTheRecord()) 39 if (IsOffTheRecord())
40 return this; 40 return this;
41 else 41 else
42 return linked_profile_; 42 return linked_profile_;
43 } 43 }
44 44
45 virtual bool HasOffTheRecordProfile() {
46 return (!IsOffTheRecord() && linked_profile_);
47 }
48
45 static void LinkProfiles(OtrTestingProfile* profile1, 49 static void LinkProfiles(OtrTestingProfile* profile1,
46 OtrTestingProfile* profile2) { 50 OtrTestingProfile* profile2) {
47 profile1->set_linked_profile(profile2); 51 profile1->set_linked_profile(profile2);
48 profile2->set_linked_profile(profile1); 52 profile2->set_linked_profile(profile1);
49 } 53 }
50 54
51 void set_linked_profile(OtrTestingProfile* profile) { 55 void set_linked_profile(OtrTestingProfile* profile) {
52 linked_profile_ = profile; 56 linked_profile_ = profile;
53 } 57 }
54 58
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 details->SetString(keys::kDomainKey, std::string(tests[i].filter)); 198 details->SetString(keys::kDomainKey, std::string(tests[i].filter));
195 extension_cookies_helpers::MatchFilter filter(details.get()); 199 extension_cookies_helpers::MatchFilter filter(details.get());
196 net::CookieMonster::CanonicalCookie cookie("", "", tests[i].domain, 200 net::CookieMonster::CanonicalCookie cookie("", "", tests[i].domain,
197 "", false, false, 201 "", false, false,
198 base::Time(), 202 base::Time(),
199 base::Time(), 203 base::Time(),
200 false, base::Time()); 204 false, base::Time());
201 EXPECT_EQ(tests[i].matches, filter.MatchesCookie(cookie)); 205 EXPECT_EQ(tests[i].matches, filter.MatchesCookie(cookie));
202 } 206 }
203 } 207 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_cookies_helpers.cc ('k') | chrome/browser/extensions/extension_incognito_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698