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 1611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1622 cookie_settings, GURL("http://example3.com")); | 1622 cookie_settings, GURL("http://example3.com")); |
1623 | 1623 |
1624 cookies_model.UpdateSearchResults( | 1624 cookies_model.UpdateSearchResults( |
1625 base::string16(base::ASCIIToUTF16("example4.com"))); | 1625 base::string16(base::ASCIIToUTF16("example4.com"))); |
1626 EXPECT_EQ("L", GetDisplayedCookies(&cookies_model)); | 1626 EXPECT_EQ("L", GetDisplayedCookies(&cookies_model)); |
1627 CheckContentSettingsUrlForHostNodes( | 1627 CheckContentSettingsUrlForHostNodes( |
1628 cookies_model.GetRoot(), CookieTreeNode::DetailedInfo::TYPE_ROOT, | 1628 cookies_model.GetRoot(), CookieTreeNode::DetailedInfo::TYPE_ROOT, |
1629 cookie_settings, GURL("http://example4.com")); | 1629 cookie_settings, GURL("http://example4.com")); |
1630 } | 1630 } |
1631 | 1631 |
| 1632 TEST_F(CookiesTreeModelTest, CookiesFilterWithoutSource) { |
| 1633 // CanonicalCookies don't persist their source_ field. This is a regression |
| 1634 // test for crbug.com/601582. |
| 1635 LocalDataContainer* container = |
| 1636 new LocalDataContainer(mock_browsing_data_cookie_helper_.get(), |
| 1637 mock_browsing_data_database_helper_.get(), |
| 1638 mock_browsing_data_local_storage_helper_.get(), |
| 1639 mock_browsing_data_session_storage_helper_.get(), |
| 1640 mock_browsing_data_appcache_helper_.get(), |
| 1641 mock_browsing_data_indexed_db_helper_.get(), |
| 1642 mock_browsing_data_file_system_helper_.get(), |
| 1643 mock_browsing_data_quota_helper_.get(), |
| 1644 mock_browsing_data_channel_id_helper_.get(), |
| 1645 mock_browsing_data_service_worker_helper_.get(), |
| 1646 mock_browsing_data_cache_storage_helper_.get(), |
| 1647 mock_browsing_data_flash_lso_helper_.get()); |
| 1648 CookiesTreeModel cookies_model(container, special_storage_policy(), false); |
| 1649 |
| 1650 mock_browsing_data_cookie_helper_-> |
| 1651 AddCookieSamples(GURL(), "A=1"); |
| 1652 mock_browsing_data_cookie_helper_->Notify(); |
| 1653 EXPECT_EQ("A", GetDisplayedCookies(&cookies_model)); |
| 1654 } |
| 1655 |
1632 } // namespace | 1656 } // namespace |
OLD | NEW |