| 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 #include "net/cookies/cookie_monster.h" | 5 #include "net/cookies/cookie_monster.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 return false; | 91 return false; |
| 92 } | 92 } |
| 93 | 93 |
| 94 bool CookieValuePredicate(const std::string& true_value, | 94 bool CookieValuePredicate(const std::string& true_value, |
| 95 const CanonicalCookie& cookie) { | 95 const CanonicalCookie& cookie) { |
| 96 return cookie.Value() == true_value; | 96 return cookie.Value() == true_value; |
| 97 } | 97 } |
| 98 | 98 |
| 99 struct CookieMonsterTestTraits { | 99 struct CookieMonsterTestTraits { |
| 100 static std::unique_ptr<CookieStore> Create() { | 100 static std::unique_ptr<CookieStore> Create() { |
| 101 return base::WrapUnique(new CookieMonster(nullptr, nullptr)); | 101 return base::MakeUnique<CookieMonster>(nullptr, nullptr); |
| 102 } | 102 } |
| 103 | 103 |
| 104 static const bool supports_http_only = true; | 104 static const bool supports_http_only = true; |
| 105 static const bool supports_non_dotted_domains = true; | 105 static const bool supports_non_dotted_domains = true; |
| 106 static const bool preserves_trailing_dots = true; | 106 static const bool preserves_trailing_dots = true; |
| 107 static const bool filters_schemes = true; | 107 static const bool filters_schemes = true; |
| 108 static const bool has_path_prefix_bug = false; | 108 static const bool has_path_prefix_bug = false; |
| 109 static const int creation_time_granularity_in_ms = 0; | 109 static const int creation_time_granularity_in_ms = 0; |
| 110 static const bool enforce_strict_secure = false; | 110 static const bool enforce_strict_secure = false; |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 struct CookieMonsterEnforcingStrictSecure { | 113 struct CookieMonsterEnforcingStrictSecure { |
| 114 static std::unique_ptr<CookieStore> Create() { | 114 static std::unique_ptr<CookieStore> Create() { |
| 115 return base::WrapUnique(new CookieMonster(nullptr, nullptr)); | 115 return base::MakeUnique<CookieMonster>(nullptr, nullptr); |
| 116 } | 116 } |
| 117 | 117 |
| 118 static const bool supports_http_only = true; | 118 static const bool supports_http_only = true; |
| 119 static const bool supports_non_dotted_domains = true; | 119 static const bool supports_non_dotted_domains = true; |
| 120 static const bool preserves_trailing_dots = true; | 120 static const bool preserves_trailing_dots = true; |
| 121 static const bool filters_schemes = true; | 121 static const bool filters_schemes = true; |
| 122 static const bool has_path_prefix_bug = false; | 122 static const bool has_path_prefix_bug = false; |
| 123 static const int creation_time_granularity_in_ms = 0; | 123 static const int creation_time_granularity_in_ms = 0; |
| 124 static const bool enforce_strict_secure = true; | 124 static const bool enforce_strict_secure = true; |
| 125 }; | 125 }; |
| (...skipping 3366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3492 monster()->AddCallbackForCookie( | 3492 monster()->AddCallbackForCookie( |
| 3493 test_url_, "abc", | 3493 test_url_, "abc", |
| 3494 base::Bind(&RecordCookieChanges, &cookies1, nullptr))); | 3494 base::Bind(&RecordCookieChanges, &cookies1, nullptr))); |
| 3495 SetCookie(monster(), test_url_, "abc=def"); | 3495 SetCookie(monster(), test_url_, "abc=def"); |
| 3496 base::RunLoop().RunUntilIdle(); | 3496 base::RunLoop().RunUntilIdle(); |
| 3497 EXPECT_EQ(1U, cookies0.size()); | 3497 EXPECT_EQ(1U, cookies0.size()); |
| 3498 EXPECT_EQ(1U, cookies0.size()); | 3498 EXPECT_EQ(1U, cookies0.size()); |
| 3499 } | 3499 } |
| 3500 | 3500 |
| 3501 } // namespace net | 3501 } // namespace net |
| OLD | NEW |