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

Unified Diff: chrome/browser/supervised_user/supervised_user_browsertest.cc

Issue 664313004: SupervisedUserService cleanup: remove some dead code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/supervised_user/supervised_user_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/supervised_user/supervised_user_browsertest.cc
diff --git a/chrome/browser/supervised_user/supervised_user_browsertest.cc b/chrome/browser/supervised_user/supervised_user_browsertest.cc
index 3fd97544ad7faa108b054a53b8954e5163bcfb2d..40d391b71b76cc5de0fdab9d375a991a8957d9ff 100644
--- a/chrome/browser/supervised_user/supervised_user_browsertest.cc
+++ b/chrome/browser/supervised_user/supervised_user_browsertest.cc
@@ -228,6 +228,9 @@ IN_PROC_BROWSER_TEST_F(SupervisedUserBlockModeTest,
HistoryVisitRecorded) {
GURL allowed_url("http://www.example.com/files/simple.html");
+ scoped_refptr<SupervisedUserURLFilter> filter =
+ supervised_user_service_->GetURLFilterForUIThread();
+
// Set the host as allowed.
scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
dict->SetBooleanWithoutPathExpansion(allowed_url.host(), true);
@@ -236,9 +239,10 @@ IN_PROC_BROWSER_TEST_F(SupervisedUserBlockModeTest,
browser()->profile());
supervised_user_settings_service->SetLocalSettingForTesting(
supervised_users::kContentPackManualBehaviorHosts, dict.Pass());
- EXPECT_EQ(
- SupervisedUserService::MANUAL_ALLOW,
- supervised_user_service_->GetManualBehaviorForHost(allowed_url.host()));
+ EXPECT_EQ(SupervisedUserURLFilter::ALLOW,
+ filter->GetFilteringBehaviorForURL(allowed_url));
+ EXPECT_EQ(SupervisedUserURLFilter::ALLOW,
+ filter->GetFilteringBehaviorForURL(allowed_url.GetWithEmptyPath()));
ui_test_utils::NavigateToURL(browser(), allowed_url);
@@ -258,13 +262,10 @@ IN_PROC_BROWSER_TEST_F(SupervisedUserBlockModeTest,
// Check that we went back to the first URL and that the manual behaviors
// have not changed.
EXPECT_EQ(allowed_url.spec(), tab->GetURL().spec());
- EXPECT_EQ(SupervisedUserService::MANUAL_ALLOW,
- supervised_user_service_->GetManualBehaviorForHost(
- "www.example.com"));
- EXPECT_EQ(
- SupervisedUserService::MANUAL_NONE,
- supervised_user_service_->GetManualBehaviorForHost(
- "www.new-example.com"));
+ EXPECT_EQ(SupervisedUserURLFilter::ALLOW,
+ filter->GetFilteringBehaviorForURL(allowed_url.GetWithEmptyPath()));
+ EXPECT_EQ(SupervisedUserURLFilter::BLOCK,
+ filter->GetFilteringBehaviorForURL(blocked_url.GetWithEmptyPath()));
// Query the history entry.
HistoryService* history_service = HistoryServiceFactory::GetForProfile(
@@ -302,9 +303,11 @@ IN_PROC_BROWSER_TEST_F(SupervisedUserBlockModeTest, Unblock) {
browser()->profile());
supervised_user_settings_service->SetLocalSettingForTesting(
supervised_users::kContentPackManualBehaviorHosts, dict.Pass());
- EXPECT_EQ(
- SupervisedUserService::MANUAL_ALLOW,
- supervised_user_service_->GetManualBehaviorForHost(test_url.host()));
+
+ scoped_refptr<SupervisedUserURLFilter> filter =
+ supervised_user_service_->GetURLFilterForUIThread();
+ EXPECT_EQ(SupervisedUserURLFilter::ALLOW,
+ filter->GetFilteringBehaviorForURL(test_url.GetWithEmptyPath()));
observer.Wait();
EXPECT_EQ(test_url, web_contents->GetURL());
« no previous file with comments | « no previous file | chrome/browser/supervised_user/supervised_user_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698