| OLD | NEW |
| 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 #include <time.h> | 5 #include <time.h> |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/platform_thread.h" | 10 #include "base/platform_thread.h" |
| (...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1210 ASSERT_TRUE(it != cookies.end()); | 1210 ASSERT_TRUE(it != cookies.end()); |
| 1211 EXPECT_EQ("www.google.izzle", it->Domain()); | 1211 EXPECT_EQ("www.google.izzle", it->Domain()); |
| 1212 EXPECT_EQ("A", it->Name()); | 1212 EXPECT_EQ("A", it->Name()); |
| 1213 | 1213 |
| 1214 ASSERT_TRUE(++it != cookies.end()); | 1214 ASSERT_TRUE(++it != cookies.end()); |
| 1215 EXPECT_EQ(".google.izzle", it->Domain()); | 1215 EXPECT_EQ(".google.izzle", it->Domain()); |
| 1216 EXPECT_EQ("C", it->Name()); | 1216 EXPECT_EQ("C", it->Name()); |
| 1217 | 1217 |
| 1218 ASSERT_TRUE(++it == cookies.end()); | 1218 ASSERT_TRUE(++it == cookies.end()); |
| 1219 | 1219 |
| 1220 // Check cookies for url excluding http-only cookies. |
| 1221 cookies = |
| 1222 cm->GetAllCookiesForURLWithOptions(url_google, net::CookieOptions()); |
| 1223 it = cookies.begin(); |
| 1224 |
| 1225 ASSERT_TRUE(it != cookies.end()); |
| 1226 EXPECT_EQ(".google.izzle", it->Domain()); |
| 1227 EXPECT_EQ("C", it->Name()); |
| 1228 |
| 1229 ASSERT_TRUE(++it == cookies.end()); |
| 1230 |
| 1220 // Test secure cookies. | 1231 // Test secure cookies. |
| 1221 cookies = cm->GetAllCookiesForURL(url_google_secure); | 1232 cookies = cm->GetAllCookiesForURL(url_google_secure); |
| 1222 it = cookies.begin(); | 1233 it = cookies.begin(); |
| 1223 | 1234 |
| 1224 ASSERT_TRUE(it != cookies.end()); | 1235 ASSERT_TRUE(it != cookies.end()); |
| 1225 EXPECT_EQ("www.google.izzle", it->Domain()); | 1236 EXPECT_EQ("www.google.izzle", it->Domain()); |
| 1226 EXPECT_EQ("A", it->Name()); | 1237 EXPECT_EQ("A", it->Name()); |
| 1227 | 1238 |
| 1228 ASSERT_TRUE(++it != cookies.end()); | 1239 ASSERT_TRUE(++it != cookies.end()); |
| 1229 EXPECT_EQ(".google.izzle", it->Domain()); | 1240 EXPECT_EQ(".google.izzle", it->Domain()); |
| (...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2052 ASSERT_TRUE(cm->SetCookieWithOptions(url_google, | 2063 ASSERT_TRUE(cm->SetCookieWithOptions(url_google, |
| 2053 std::string(kValidCookieLine) + "; expires=Mon, 18-Apr-1977 22:50:13 GMT", | 2064 std::string(kValidCookieLine) + "; expires=Mon, 18-Apr-1977 22:50:13 GMT", |
| 2054 options)); | 2065 options)); |
| 2055 | 2066 |
| 2056 // Check that the cookie was deleted. | 2067 // Check that the cookie was deleted. |
| 2057 cookie_list = cm->GetAllCookies(); | 2068 cookie_list = cm->GetAllCookies(); |
| 2058 ASSERT_EQ(0U, cookie_list.size()); | 2069 ASSERT_EQ(0U, cookie_list.size()); |
| 2059 } | 2070 } |
| 2060 | 2071 |
| 2061 } // namespace | 2072 } // namespace |
| OLD | NEW |