OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "ios/net/cookies/cookie_store_ios.h" | 5 #include "ios/net/cookies/cookie_store_ios.h" |
6 | 6 |
7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
8 | 8 |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 return store; | 35 return store; |
36 } | 36 } |
37 | 37 |
38 static const bool is_cookie_monster = false; | 38 static const bool is_cookie_monster = false; |
39 static const bool supports_http_only = false; | 39 static const bool supports_http_only = false; |
40 static const bool supports_non_dotted_domains = false; | 40 static const bool supports_non_dotted_domains = false; |
41 static const bool preserves_trailing_dots = false; | 41 static const bool preserves_trailing_dots = false; |
42 static const bool filters_schemes = false; | 42 static const bool filters_schemes = false; |
43 static const bool has_path_prefix_bug = true; | 43 static const bool has_path_prefix_bug = true; |
44 static const int creation_time_granularity_in_ms = 1000; | 44 static const int creation_time_granularity_in_ms = 1000; |
| 45 static const int enforces_prefixes = true; |
45 | 46 |
46 base::MessageLoop loop_; | 47 base::MessageLoop loop_; |
47 }; | 48 }; |
48 | 49 |
49 struct InactiveCookieStoreIOSTestTraits { | 50 struct InactiveCookieStoreIOSTestTraits { |
50 static scoped_refptr<net::CookieStore> Create() { | 51 static scoped_refptr<net::CookieStore> Create() { |
51 return new CookieStoreIOS(nullptr); | 52 return new CookieStoreIOS(nullptr); |
52 } | 53 } |
53 | 54 |
54 static const bool is_cookie_monster = false; | 55 static const bool is_cookie_monster = false; |
55 static const bool supports_http_only = false; | 56 static const bool supports_http_only = false; |
56 static const bool supports_non_dotted_domains = true; | 57 static const bool supports_non_dotted_domains = true; |
57 static const bool preserves_trailing_dots = true; | 58 static const bool preserves_trailing_dots = true; |
58 static const bool filters_schemes = false; | 59 static const bool filters_schemes = false; |
59 static const bool has_path_prefix_bug = false; | 60 static const bool has_path_prefix_bug = false; |
60 static const int creation_time_granularity_in_ms = 0; | 61 static const int creation_time_granularity_in_ms = 0; |
| 62 static const int enforces_prefixes = true; |
61 | 63 |
62 base::MessageLoop loop_; | 64 base::MessageLoop loop_; |
63 }; | 65 }; |
64 | 66 |
65 // RoundTripTestCookieStore is un-synchronized and re-synchronized after all | 67 // RoundTripTestCookieStore is un-synchronized and re-synchronized after all |
66 // cookie operations. This means all system cookies are converted to Chrome | 68 // cookie operations. This means all system cookies are converted to Chrome |
67 // cookies and converted back. | 69 // cookies and converted back. |
68 // The purpose of this class is to test that cookie conversions do not break the | 70 // The purpose of this class is to test that cookie conversions do not break the |
69 // cookie store. | 71 // cookie store. |
70 class RoundTripTestCookieStore : public net::CookieStore { | 72 class RoundTripTestCookieStore : public net::CookieStore { |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 return new RoundTripTestCookieStore(); | 163 return new RoundTripTestCookieStore(); |
162 } | 164 } |
163 | 165 |
164 static const bool is_cookie_monster = false; | 166 static const bool is_cookie_monster = false; |
165 static const bool supports_http_only = false; | 167 static const bool supports_http_only = false; |
166 static const bool supports_non_dotted_domains = false; | 168 static const bool supports_non_dotted_domains = false; |
167 static const bool preserves_trailing_dots = false; | 169 static const bool preserves_trailing_dots = false; |
168 static const bool filters_schemes = false; | 170 static const bool filters_schemes = false; |
169 static const bool has_path_prefix_bug = true; | 171 static const bool has_path_prefix_bug = true; |
170 static const int creation_time_granularity_in_ms = 1000; | 172 static const int creation_time_granularity_in_ms = 1000; |
| 173 static const int enforces_prefixes = true; |
171 }; | 174 }; |
172 | 175 |
173 } // namespace net | 176 } // namespace net |
174 | 177 |
175 namespace net { | 178 namespace net { |
176 | 179 |
177 INSTANTIATE_TYPED_TEST_CASE_P(CookieStoreIOS, | 180 INSTANTIATE_TYPED_TEST_CASE_P(CookieStoreIOS, |
178 CookieStoreTest, | 181 CookieStoreTest, |
179 CookieStoreIOSTestTraits); | 182 CookieStoreIOSTestTraits); |
180 | 183 |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
941 EXPECT_EQ(2U, cookies.size()); | 944 EXPECT_EQ(2U, cookies.size()); |
942 // this deletes the callback | 945 // this deletes the callback |
943 handle.reset(); | 946 handle.reset(); |
944 SetSystemCookie(kTestCookieURL, "abc", "jkl"); | 947 SetSystemCookie(kTestCookieURL, "abc", "jkl"); |
945 EXPECT_EQ(2U, cookies.size()); | 948 EXPECT_EQ(2U, cookies.size()); |
946 DeleteSystemCookie(kTestCookieURL, "abc"); | 949 DeleteSystemCookie(kTestCookieURL, "abc"); |
947 store_->UnSynchronize(); | 950 store_->UnSynchronize(); |
948 } | 951 } |
949 | 952 |
950 } // namespace net | 953 } // namespace net |
OLD | NEW |