OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
13 #include "net/base/cookie_monster.h" | 13 #include "net/base/cookie_monster.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
| 16 using base::Time; |
| 17 using base::TimeDelta; |
| 18 |
16 namespace { | 19 namespace { |
17 class ParsedCookieTest : public testing::Test { }; | 20 class ParsedCookieTest : public testing::Test { }; |
18 class CookieMonsterTest : public testing::Test { }; | 21 class CookieMonsterTest : public testing::Test { }; |
19 } | 22 } |
20 | 23 |
21 | 24 |
22 TEST(ParsedCookieTest, TestBasic) { | 25 TEST(ParsedCookieTest, TestBasic) { |
23 net::CookieMonster::ParsedCookie pc("a=b"); | 26 net::CookieMonster::ParsedCookie pc("a=b"); |
24 EXPECT_TRUE(pc.IsValid()); | 27 EXPECT_TRUE(pc.IsValid()); |
25 EXPECT_FALSE(pc.IsSecure()); | 28 EXPECT_FALSE(pc.IsSecure()); |
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 | 807 |
805 EXPECT_TRUE(FindAndDeleteCookie(cm, url_google.host(), "C")); | 808 EXPECT_TRUE(FindAndDeleteCookie(cm, url_google.host(), "C")); |
806 EXPECT_EQ("A=B; E=F", cm.GetCookies(url_google)); | 809 EXPECT_EQ("A=B; E=F", cm.GetCookies(url_google)); |
807 | 810 |
808 EXPECT_FALSE(FindAndDeleteCookie(cm, "random.host", "E")); | 811 EXPECT_FALSE(FindAndDeleteCookie(cm, "random.host", "E")); |
809 EXPECT_EQ("A=B; E=F", cm.GetCookies(url_google)); | 812 EXPECT_EQ("A=B; E=F", cm.GetCookies(url_google)); |
810 } | 813 } |
811 | 814 |
812 // TODO test overwrite cookie | 815 // TODO test overwrite cookie |
813 | 816 |
OLD | NEW |