| 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/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1597 | 1597 |
| 1598 EXPECT_EQ(1, origin->child_count()); | 1598 EXPECT_EQ(1, origin->child_count()); |
| 1599 EXPECT_TRUE(origin->CanCreateContentException()); | 1599 EXPECT_TRUE(origin->CanCreateContentException()); |
| 1600 EXPECT_CALL(observer, OnContentSettingsChanged( | 1600 EXPECT_CALL(observer, OnContentSettingsChanged( |
| 1601 content_settings, CONTENT_SETTINGS_TYPE_COOKIES, | 1601 content_settings, CONTENT_SETTINGS_TYPE_COOKIES, |
| 1602 false, ContentSettingsPattern::FromURL(host), | 1602 false, ContentSettingsPattern::FromURL(host), |
| 1603 ContentSettingsPattern::Wildcard(), false)) | 1603 ContentSettingsPattern::Wildcard(), false)) |
| 1604 .Times(2); | 1604 .Times(2); |
| 1605 origin->CreateContentException( | 1605 origin->CreateContentException( |
| 1606 cookie_settings, CONTENT_SETTING_SESSION_ONLY); | 1606 cookie_settings, CONTENT_SETTING_SESSION_ONLY); |
| 1607 EXPECT_TRUE(cookie_settings->IsReadingCookieAllowed(host, host)); | 1607 EXPECT_TRUE(cookie_settings->IsCookieAccessAllowed(host, host)); |
| 1608 EXPECT_TRUE(cookie_settings->IsCookieSessionOnly(host)); | 1608 EXPECT_TRUE(cookie_settings->IsCookieSessionOnly(host)); |
| 1609 } | 1609 } |
| 1610 | 1610 |
| 1611 TEST_F(CookiesTreeModelTest, FileSystemFilter) { | 1611 TEST_F(CookiesTreeModelTest, FileSystemFilter) { |
| 1612 std::unique_ptr<CookiesTreeModel> cookies_model( | 1612 std::unique_ptr<CookiesTreeModel> cookies_model( |
| 1613 CreateCookiesTreeModelWithInitialSample()); | 1613 CreateCookiesTreeModelWithInitialSample()); |
| 1614 | 1614 |
| 1615 cookies_model->UpdateSearchResults(base::ASCIIToUTF16("fshost1")); | 1615 cookies_model->UpdateSearchResults(base::ASCIIToUTF16("fshost1")); |
| 1616 EXPECT_EQ("http://fshost1:1/", | 1616 EXPECT_EQ("http://fshost1:1/", |
| 1617 GetDisplayedFileSystems(cookies_model.get())); | 1617 GetDisplayedFileSystems(cookies_model.get())); |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1859 "http://host1:1/,http://host2:2/,http-so://foobar.host3:3/," | 1859 "http://host1:1/,http://host2:2/,http-so://foobar.host3:3/," |
| 1860 "http-so://foobar.host4:4/,http://host4:4/", | 1860 "http-so://foobar.host4:4/,http://host4:4/", |
| 1861 GetDisplayedLocalStorages(&cookies_model)); | 1861 GetDisplayedLocalStorages(&cookies_model)); |
| 1862 // Delete host4, which should delete foobar_host4:4 in addition to host4:4 | 1862 // Delete host4, which should delete foobar_host4:4 in addition to host4:4 |
| 1863 DeleteStoredObjects(cookies_model.GetRoot()->GetChild(3)); | 1863 DeleteStoredObjects(cookies_model.GetRoot()->GetChild(3)); |
| 1864 EXPECT_EQ(10, cookies_model.GetRoot()->GetTotalNodeCount()); | 1864 EXPECT_EQ(10, cookies_model.GetRoot()->GetTotalNodeCount()); |
| 1865 } | 1865 } |
| 1866 } | 1866 } |
| 1867 | 1867 |
| 1868 } // namespace | 1868 } // namespace |
| OLD | NEW |