Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Side by Side Diff: net/base/cookie_monster_unittest.cc

Issue 8473010: Mark a cookie as session cookie, if the expiry date cannot be parsed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/base/cookie_monster.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « net/base/cookie_monster.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698