| 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/canonical_cookie.h" | 5 #include "net/cookies/canonical_cookie.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "googleurl/src/gurl.h" | |
| 9 #include "net/cookies/cookie_constants.h" | 8 #include "net/cookies/cookie_constants.h" |
| 10 #include "net/cookies/cookie_options.h" | 9 #include "net/cookies/cookie_options.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include "url/gurl.h" |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 | 14 |
| 15 TEST(CanonicalCookieTest, GetCookieSourceFromURL) { | 15 TEST(CanonicalCookieTest, GetCookieSourceFromURL) { |
| 16 EXPECT_EQ("http://example.com/", | 16 EXPECT_EQ("http://example.com/", |
| 17 CanonicalCookie::GetCookieSourceFromURL( | 17 CanonicalCookie::GetCookieSourceFromURL( |
| 18 GURL("http://example.com"))); | 18 GURL("http://example.com"))); |
| 19 EXPECT_EQ("http://example.com/", | 19 EXPECT_EQ("http://example.com/", |
| 20 CanonicalCookie::GetCookieSourceFromURL( | 20 CanonicalCookie::GetCookieSourceFromURL( |
| 21 GURL("http://example.com/"))); | 21 GURL("http://example.com/"))); |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 options.set_include_httponly(); | 355 options.set_include_httponly(); |
| 356 cookie.reset( | 356 cookie.reset( |
| 357 CanonicalCookie::Create(url, "A=2; HttpOnly", creation_time, options)); | 357 CanonicalCookie::Create(url, "A=2; HttpOnly", creation_time, options)); |
| 358 EXPECT_TRUE(cookie->IsHttpOnly()); | 358 EXPECT_TRUE(cookie->IsHttpOnly()); |
| 359 EXPECT_TRUE(cookie->IncludeForRequestURL(url, options)); | 359 EXPECT_TRUE(cookie->IncludeForRequestURL(url, options)); |
| 360 options.set_exclude_httponly(); | 360 options.set_exclude_httponly(); |
| 361 EXPECT_FALSE(cookie->IncludeForRequestURL(url, options)); | 361 EXPECT_FALSE(cookie->IncludeForRequestURL(url, options)); |
| 362 } | 362 } |
| 363 | 363 |
| 364 } // namespace net | 364 } // namespace net |
| OLD | NEW |