OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 3552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3563 EXPECT_EQ(1U, cookies.size()); | 3563 EXPECT_EQ(1U, cookies.size()); |
3564 | 3564 |
3565 // Get cookies after the cookie has expired. | 3565 // Get cookies after the cookie has expired. |
3566 cookies.clear(); | 3566 cookies.clear(); |
3567 cm->FindCookiesForKey(cm->GetKey(url_google_.host()), url_google_, | 3567 cm->FindCookiesForKey(cm->GetKey(url_google_.host()), url_google_, |
3568 CookieOptions(), current + TimeDelta::FromSeconds(20), | 3568 CookieOptions(), current + TimeDelta::FromSeconds(20), |
3569 false, &cookies); | 3569 false, &cookies); |
3570 EXPECT_EQ(0U, cookies.size()); | 3570 EXPECT_EQ(0U, cookies.size()); |
3571 } | 3571 } |
3572 | 3572 |
| 3573 TEST_F(CookieMonsterTest, InvalidExpiryTime) { |
| 3574 CookieMonster::ParsedCookie pc( |
| 3575 std::string(kValidCookieLine) + "; expires=Blarg arg arg"); |
| 3576 scoped_ptr<CookieMonster::CanonicalCookie> cookie( |
| 3577 CookieMonster::CanonicalCookie::Create(url_google_, pc)); |
| 3578 |
| 3579 ASSERT_FALSE(cookie->DoesExpire()); |
| 3580 } |
| 3581 |
3573 } // namespace net | 3582 } // namespace net |
OLD | NEW |