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 // 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 Loading... |
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 |
OLD | NEW |