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

Side by Side Diff: chrome/browser/browsing_data_cookie_helper_unittest.cc

Issue 7355025: Creat BrowsingDataCookieHelper and CannedBrowsingDataCookieHelper for logging cookies at UI thread. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 5 months 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/browsing_data_cookie_helper.h"
6
7 #include "chrome/test/testing_browser_process_test.h"
8 #include "chrome/test/testing_profile.h"
9 #include "testing/gtest/include/gtest/gtest.h"
10
11 namespace {
12
13 typedef TestingBrowserProcessTest CannedBrowsingDataCookieTest;
14
15 TEST_F(CannedBrowsingDataCookieTest, Empty) {
16 TestingProfile profile;
17
18 const GURL url_google("http://www.google.com");
19
20 scoped_refptr<CannedBrowsingDataCookieHelper> helper(
21 new CannedBrowsingDataCookieHelper(&profile));
22
23 ASSERT_TRUE(helper->empty());
24 helper->AddChangeCookie(url_google, "a=1",
25 net::CookieOptions());
26 ASSERT_FALSE(helper->empty());
27 helper->Reset();
28 ASSERT_TRUE(helper->empty());
29
30 net::CookieList cookies;
31 net::CookieMonster::ParsedCookie pc("a=1");
32 scoped_ptr<net::CookieMonster::CanonicalCookie> cookie(
33 new net::CookieMonster::CanonicalCookie(url_google, pc));
34 cookies.push_back(*cookie);
35
36 helper->AddReadCookie(url_google, cookies);
37 ASSERT_FALSE(helper->empty());
38 helper->Reset();
39 ASSERT_TRUE(helper->empty());
40 }
41
42 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698