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

Side by Side Diff: chrome/browser/browsing_data/cookies_tree_model_unittest.cc

Issue 1895993003: Add migration code to change existing domain scoped content settings to be origin scoped (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
OLDNEW
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/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after
1424 1424
1425 CookieTreeRootNode* root = 1425 CookieTreeRootNode* root =
1426 static_cast<CookieTreeRootNode*>(cookies_model.GetRoot()); 1426 static_cast<CookieTreeRootNode*>(cookies_model.GetRoot());
1427 CookieTreeHostNode* origin = 1427 CookieTreeHostNode* origin =
1428 root->GetOrCreateHostNode(host); 1428 root->GetOrCreateHostNode(host);
1429 1429
1430 EXPECT_EQ(1, origin->child_count()); 1430 EXPECT_EQ(1, origin->child_count());
1431 EXPECT_TRUE(origin->CanCreateContentException()); 1431 EXPECT_TRUE(origin->CanCreateContentException());
1432 EXPECT_CALL(observer, OnContentSettingsChanged( 1432 EXPECT_CALL(observer, OnContentSettingsChanged(
1433 content_settings, CONTENT_SETTINGS_TYPE_COOKIES, 1433 content_settings, CONTENT_SETTINGS_TYPE_COOKIES,
1434 false, ContentSettingsPattern::FromURL(host), 1434 false,
1435 ContentSettingsPattern::FromURLNoWildcard(host),
1435 ContentSettingsPattern::Wildcard(), false)) 1436 ContentSettingsPattern::Wildcard(), false))
1436 .Times(2); 1437 .Times(2);
1437 origin->CreateContentException( 1438 origin->CreateContentException(
1438 cookie_settings, CONTENT_SETTING_SESSION_ONLY); 1439 cookie_settings, CONTENT_SETTING_SESSION_ONLY);
1439 EXPECT_TRUE(cookie_settings->IsReadingCookieAllowed(host, host)); 1440 EXPECT_TRUE(cookie_settings->IsReadingCookieAllowed(host, host));
1440 EXPECT_TRUE(cookie_settings->IsCookieSessionOnly(host)); 1441 EXPECT_TRUE(cookie_settings->IsCookieSessionOnly(host));
1441 } 1442 }
1442 1443
1443 TEST_F(CookiesTreeModelTest, FileSystemFilter) { 1444 TEST_F(CookiesTreeModelTest, FileSystemFilter) {
1444 std::unique_ptr<CookiesTreeModel> cookies_model( 1445 std::unique_ptr<CookiesTreeModel> cookies_model(
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
1648 mock_browsing_data_flash_lso_helper_.get()); 1649 mock_browsing_data_flash_lso_helper_.get());
1649 CookiesTreeModel cookies_model(container, special_storage_policy(), false); 1650 CookiesTreeModel cookies_model(container, special_storage_policy(), false);
1650 1651
1651 mock_browsing_data_cookie_helper_-> 1652 mock_browsing_data_cookie_helper_->
1652 AddCookieSamples(GURL(), "A=1"); 1653 AddCookieSamples(GURL(), "A=1");
1653 mock_browsing_data_cookie_helper_->Notify(); 1654 mock_browsing_data_cookie_helper_->Notify();
1654 EXPECT_EQ("A", GetDisplayedCookies(&cookies_model)); 1655 EXPECT_EQ("A", GetDisplayedCookies(&cookies_model));
1655 } 1656 }
1656 1657
1657 } // namespace 1658 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698