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

Unified Diff: chrome/browser/managed_mode/managed_mode_browsertest.cc

Issue 23533014: Watch for filtering pref changes in ManagedModeInterstitial and unblock requests if they become… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 7 years, 3 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/managed_mode/managed_mode_interstitial.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/managed_mode/managed_mode_browsertest.cc
diff --git a/chrome/browser/managed_mode/managed_mode_browsertest.cc b/chrome/browser/managed_mode/managed_mode_browsertest.cc
index 7199ee5e6554db4210974a6cf31d05f9ddc168a1..ab7488dc19321a7780304923c9dd67a60ffea5a9 100644
--- a/chrome/browser/managed_mode/managed_mode_browsertest.cc
+++ b/chrome/browser/managed_mode/managed_mode_browsertest.cc
@@ -238,4 +238,36 @@ IN_PROC_BROWSER_TEST_F(ManagedModeBlockModeTest,
EXPECT_FALSE(results[1].blocked_visit());
}
+IN_PROC_BROWSER_TEST_F(ManagedModeBlockModeTest, Unblock) {
+ GURL test_url("http://www.example.com/files/simple.html");
+ ui_test_utils::NavigateToURL(browser(), test_url);
+
+ WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
+
+ CheckShownPageIsInterstitial(web_contents);
+
+ content::WindowedNotificationObserver observer(
+ content::NOTIFICATION_LOAD_STOP,
+ content::NotificationService::AllSources());
+
+ // Set the host as allowed.
+ scoped_ptr<DictionaryValue> dict(new DictionaryValue);
+ dict->SetBooleanWithoutPathExpansion(test_url.host(), true);
+ policy::ProfilePolicyConnector* connector =
+ policy::ProfilePolicyConnectorFactory::GetForProfile(
+ browser()->profile());
+ policy::ManagedModePolicyProvider* policy_provider =
+ connector->managed_mode_policy_provider();
+ policy_provider->SetLocalPolicyForTesting(
+ policy::key::kContentPackManualBehaviorHosts, dict.PassAs<Value>());
+ base::RunLoop().RunUntilIdle();
+ EXPECT_EQ(
+ ManagedUserService::MANUAL_ALLOW,
+ managed_user_service_->GetManualBehaviorForHost(test_url.host()));
+
+ observer.Wait();
+ EXPECT_EQ(test_url, web_contents->GetURL());
+}
+
} // namespace
« no previous file with comments | « no previous file | chrome/browser/managed_mode/managed_mode_interstitial.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698