OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 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.izzle"); |
| 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 net::CookieList cookies = helper->cookie_list(); |
| 28 helper->Reset(); |
| 29 ASSERT_TRUE(helper->empty()); |
| 30 |
| 31 helper->AddReadCookie(url_google, cookies); |
| 32 ASSERT_FALSE(helper->empty()); |
| 33 helper->Reset(); |
| 34 ASSERT_TRUE(helper->empty()); |
| 35 } |
| 36 |
| 37 } // namespace |
OLD | NEW |