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

Side by Side Diff: chrome/browser/extensions/api/cookies/cookies_unittest.cc

Issue 2882063002: Add a SetCanonicalCookie method for CookieMonster. (Closed)
Patch Set: Fix AW cookie store wrapper. Created 3 years, 6 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) 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 // 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 <stddef.h> 8 #include <stddef.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 net::CookieSameSite::DEFAULT_MODE, net::COOKIE_PRIORITY_DEFAULT)); 181 net::CookieSameSite::DEFAULT_MODE, net::COOKIE_PRIORITY_DEFAULT));
182 ASSERT_NE(nullptr, cookie.get()); 182 ASSERT_NE(nullptr, cookie.get());
183 EXPECT_EQ(tests[i].matches, filter.MatchesCookie(*cookie)) << " test " << i; 183 EXPECT_EQ(tests[i].matches, filter.MatchesCookie(*cookie)) << " test " << i;
184 } 184 }
185 } 185 }
186 186
187 TEST_F(ExtensionCookiesTest, DecodeUTF8WithErrorHandling) { 187 TEST_F(ExtensionCookiesTest, DecodeUTF8WithErrorHandling) {
188 std::unique_ptr<net::CanonicalCookie> canonical_cookie( 188 std::unique_ptr<net::CanonicalCookie> canonical_cookie(
189 net::CanonicalCookie::Create(GURL("http://test.com"), 189 net::CanonicalCookie::Create(GURL("http://test.com"),
190 "=011Q255bNX_1!yd\203e+;path=/path\203", 190 "=011Q255bNX_1!yd\203e+;path=/path\203",
191 base::Time(), net::CookieOptions())); 191 base::Time::Now(), net::CookieOptions()));
192 ASSERT_NE(nullptr, canonical_cookie.get()); 192 ASSERT_NE(nullptr, canonical_cookie.get());
193 Cookie cookie = 193 Cookie cookie =
194 cookies_helpers::CreateCookie(*canonical_cookie, "some cookie store"); 194 cookies_helpers::CreateCookie(*canonical_cookie, "some cookie store");
195 EXPECT_EQ(std::string("011Q255bNX_1!yd\xEF\xBF\xBD" 195 EXPECT_EQ(std::string("011Q255bNX_1!yd\xEF\xBF\xBD"
196 "e+"), 196 "e+"),
197 cookie.value); 197 cookie.value);
198 EXPECT_EQ(std::string(), cookie.path); 198 EXPECT_EQ(std::string(), cookie.path);
199 } 199 }
200 200
201 } // namespace extensions 201 } // namespace extensions
OLDNEW
« no previous file with comments | « android_webview/browser/net/aw_cookie_store_wrapper.cc ('k') | headless/public/util/testing/generic_url_request_mocks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698