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

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

Issue 2075103002: Change ContentSettingsType's scoping type and hookup migration code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@do_migration_after_sync
Patch Set: revise test Created 4 years, 5 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/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after
1422 CookieSettingsFactory::GetForProfile(&profile).get(); 1422 CookieSettingsFactory::GetForProfile(&profile).get();
1423 MockSettingsObserver observer(content_settings); 1423 MockSettingsObserver observer(content_settings);
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,
1433 content_settings, CONTENT_SETTINGS_TYPE_COOKIES, 1433 OnContentSettingsChanged(
1434 false, ContentSettingsPattern::FromURL(host), 1434 content_settings, CONTENT_SETTINGS_TYPE_COOKIES, false,
1435 ContentSettingsPattern::Wildcard(), false)) 1435 ContentSettingsPattern::FromURLNoWildcard(host),
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(
1445 CreateCookiesTreeModelWithInitialSample()); 1446 CreateCookiesTreeModelWithInitialSample());
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
1647 mock_browsing_data_flash_lso_helper_.get()); 1648 mock_browsing_data_flash_lso_helper_.get());
1648 CookiesTreeModel cookies_model(container, special_storage_policy()); 1649 CookiesTreeModel cookies_model(container, special_storage_policy());
1649 1650
1650 mock_browsing_data_cookie_helper_-> 1651 mock_browsing_data_cookie_helper_->
1651 AddCookieSamples(GURL(), "A=1"); 1652 AddCookieSamples(GURL(), "A=1");
1652 mock_browsing_data_cookie_helper_->Notify(); 1653 mock_browsing_data_cookie_helper_->Notify();
1653 EXPECT_EQ("A", GetDisplayedCookies(&cookies_model)); 1654 EXPECT_EQ("A", GetDisplayedCookies(&cookies_model));
1654 } 1655 }
1655 1656
1656 } // namespace 1657 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698