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