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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/browsing_data_cookie_helper_unittest.cc
===================================================================
--- chrome/browser/browsing_data_cookie_helper_unittest.cc (revision 0)
+++ chrome/browser/browsing_data_cookie_helper_unittest.cc (revision 0)
@@ -0,0 +1,42 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/browsing_data_cookie_helper.h"
+
+#include "chrome/test/testing_browser_process_test.h"
+#include "chrome/test/testing_profile.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace {
+
+typedef TestingBrowserProcessTest CannedBrowsingDataCookieTest;
+
+TEST_F(CannedBrowsingDataCookieTest, Empty) {
+ TestingProfile profile;
+
+ const GURL url_google("http://www.google.com");
+
+ scoped_refptr<CannedBrowsingDataCookieHelper> helper(
+ new CannedBrowsingDataCookieHelper(&profile));
+
+ ASSERT_TRUE(helper->empty());
+ helper->AddChangeCookie(url_google, "a=1",
+ net::CookieOptions());
+ ASSERT_FALSE(helper->empty());
+ helper->Reset();
+ ASSERT_TRUE(helper->empty());
+
+ net::CookieList cookies;
+ net::CookieMonster::ParsedCookie pc("a=1");
+ scoped_ptr<net::CookieMonster::CanonicalCookie> cookie(
+ new net::CookieMonster::CanonicalCookie(url_google, pc));
+ cookies.push_back(*cookie);
+
+ helper->AddReadCookie(url_google, cookies);
+ ASSERT_FALSE(helper->empty());
+ helper->Reset();
+ ASSERT_TRUE(helper->empty());
+}
+
+} // namespace
Property changes on: chrome/browser/browsing_data_cookie_helper_unittest.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698