| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/browsing_data/cookies_tree_model.h" | 5 #include "chrome/browser/browsing_data/cookies_tree_model.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1634 cookie_settings, GURL("http://example3.com")); | 1634 cookie_settings, GURL("http://example3.com")); |
| 1635 | 1635 |
| 1636 cookies_model.UpdateSearchResults( | 1636 cookies_model.UpdateSearchResults( |
| 1637 base::string16(base::ASCIIToUTF16("example4.com"))); | 1637 base::string16(base::ASCIIToUTF16("example4.com"))); |
| 1638 EXPECT_EQ("L", GetDisplayedCookies(&cookies_model)); | 1638 EXPECT_EQ("L", GetDisplayedCookies(&cookies_model)); |
| 1639 CheckContentSettingsUrlForHostNodes( | 1639 CheckContentSettingsUrlForHostNodes( |
| 1640 cookies_model.GetRoot(), CookieTreeNode::DetailedInfo::TYPE_ROOT, | 1640 cookies_model.GetRoot(), CookieTreeNode::DetailedInfo::TYPE_ROOT, |
| 1641 cookie_settings, GURL("http://example4.com")); | 1641 cookie_settings, GURL("http://example4.com")); |
| 1642 } | 1642 } |
| 1643 | 1643 |
| 1644 TEST_F(CookiesTreeModelTest, CookiesFilterWithoutSource) { |
| 1645 // CanonicalCookies don't persist their source_ field. This is a regression |
| 1646 // test for crbug.com/601582. |
| 1647 LocalDataContainer* container = |
| 1648 new LocalDataContainer(mock_browsing_data_cookie_helper_.get(), |
| 1649 mock_browsing_data_database_helper_.get(), |
| 1650 mock_browsing_data_local_storage_helper_.get(), |
| 1651 mock_browsing_data_session_storage_helper_.get(), |
| 1652 mock_browsing_data_appcache_helper_.get(), |
| 1653 mock_browsing_data_indexed_db_helper_.get(), |
| 1654 mock_browsing_data_file_system_helper_.get(), |
| 1655 mock_browsing_data_quota_helper_.get(), |
| 1656 mock_browsing_data_channel_id_helper_.get(), |
| 1657 mock_browsing_data_service_worker_helper_.get(), |
| 1658 mock_browsing_data_cache_storage_helper_.get(), |
| 1659 mock_browsing_data_flash_lso_helper_.get()); |
| 1660 CookiesTreeModel cookies_model(container, special_storage_policy(), false); |
| 1661 |
| 1662 mock_browsing_data_cookie_helper_-> |
| 1663 AddCookieSamples(GURL(), "A=1"); |
| 1664 mock_browsing_data_cookie_helper_->Notify(); |
| 1665 EXPECT_EQ("A", GetDisplayedCookies(&cookies_model)); |
| 1666 } |
| 1667 |
| 1644 } // namespace | 1668 } // namespace |
| OLD | NEW |