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

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

Issue 3210007: Add support for a "split" incognito behavior for extensions. (Closed)
Patch Set: latest Created 10 years, 3 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
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 "0", &profile, false)); 76 "0", &profile, false));
77 EXPECT_EQ(&otrProfile, 77 EXPECT_EQ(&otrProfile,
78 extension_cookies_helpers::ChooseProfileFromStoreId( 78 extension_cookies_helpers::ChooseProfileFromStoreId(
79 "1", &profile, true)); 79 "1", &profile, true));
80 EXPECT_EQ(NULL, 80 EXPECT_EQ(NULL,
81 extension_cookies_helpers::ChooseProfileFromStoreId( 81 extension_cookies_helpers::ChooseProfileFromStoreId(
82 "1", &profile, false)); 82 "1", &profile, false));
83 83
84 EXPECT_EQ(std::string("1"), 84 EXPECT_EQ(std::string("1"),
85 extension_cookies_helpers::GetStoreIdFromProfile(&otrProfile)); 85 extension_cookies_helpers::GetStoreIdFromProfile(&otrProfile));
86 EXPECT_EQ(&profile, 86 EXPECT_EQ(NULL,
87 extension_cookies_helpers::ChooseProfileFromStoreId( 87 extension_cookies_helpers::ChooseProfileFromStoreId(
88 "0", &otrProfile, true)); 88 "0", &otrProfile, true));
89 EXPECT_EQ(&profile, 89 EXPECT_EQ(NULL,
90 extension_cookies_helpers::ChooseProfileFromStoreId( 90 extension_cookies_helpers::ChooseProfileFromStoreId(
91 "0", &otrProfile, false)); 91 "0", &otrProfile, false));
92 EXPECT_EQ(&otrProfile, 92 EXPECT_EQ(&otrProfile,
93 extension_cookies_helpers::ChooseProfileFromStoreId( 93 extension_cookies_helpers::ChooseProfileFromStoreId(
94 "1", &otrProfile, true)); 94 "1", &otrProfile, true));
95 EXPECT_EQ(NULL, 95 EXPECT_EQ(&otrProfile,
96 extension_cookies_helpers::ChooseProfileFromStoreId( 96 extension_cookies_helpers::ChooseProfileFromStoreId(
97 "1", &otrProfile, false)); 97 "1", &otrProfile, false));
98 } 98 }
99 99
100 TEST_F(ExtensionCookiesTest, ExtensionTypeCreation) { 100 TEST_F(ExtensionCookiesTest, ExtensionTypeCreation) {
101 std::string string_value; 101 std::string string_value;
102 bool boolean_value; 102 bool boolean_value;
103 double double_value; 103 double double_value;
104 Value* value; 104 Value* value;
105 105
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 details->SetString(keys::kDomainKey, std::string(tests[i].filter)); 194 details->SetString(keys::kDomainKey, std::string(tests[i].filter));
195 extension_cookies_helpers::MatchFilter filter(details.get()); 195 extension_cookies_helpers::MatchFilter filter(details.get());
196 net::CookieMonster::CanonicalCookie cookie("", "", tests[i].domain, 196 net::CookieMonster::CanonicalCookie cookie("", "", tests[i].domain,
197 "", false, false, 197 "", false, false,
198 base::Time(), 198 base::Time(),
199 base::Time(), 199 base::Time(),
200 false, base::Time()); 200 false, base::Time());
201 EXPECT_EQ(tests[i].matches, filter.MatchesCookie(cookie)); 201 EXPECT_EQ(tests[i].matches, filter.MatchesCookie(cookie));
202 } 202 }
203 } 203 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_cookies_helpers.cc ('k') | chrome/browser/extensions/extension_devtools_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698