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

Unified Diff: chrome/browser/policy/policy_browsertest.cc

Issue 344693004: Add a policy to re-enable deprecated web platform features. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to ToT Created 6 years, 6 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 | « chrome/browser/policy/configuration_policy_handler_list_factory.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/policy_browsertest.cc
diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc
index 7b832a142168df0249cb5e42c431fa5223fc79a7..04be3f530deed46a70ede70b7eb8758a18dc85f5 100644
--- a/chrome/browser/policy/policy_browsertest.cc
+++ b/chrome/browser/policy/policy_browsertest.cc
@@ -3015,6 +3015,31 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, NativeMessagingWhitelist) {
prefs, "other.host.name"));
}
+IN_PROC_BROWSER_TEST_F(PolicyTest,
+ EnableDeprecatedWebPlatformFeatures_ShowModalDialog) {
+ base::ListValue enabled_features;
+ enabled_features.Append(new base::StringValue(
+ "ShowModalDialog_EffectiveUntil20150430"));
+ PolicyMap policies;
+ policies.Set(key::kEnableDeprecatedWebPlatformFeatures,
+ POLICY_LEVEL_MANDATORY,
+ POLICY_SCOPE_USER,
+ enabled_features.DeepCopy(),
+ NULL);
+ UpdateProviderPolicy(policies);
+
+ // Policy only takes effect on new browsers, not existing browsers, so create
+ // a new browser.
+ Browser* browser2 = CreateBrowser(browser()->profile());
+ ui_test_utils::NavigateToURL(browser2, GURL(url::kAboutBlankURL));
+ bool result = false;
+ EXPECT_TRUE(content::ExecuteScriptAndExtractBool(
+ browser2->tab_strip_model()->GetActiveWebContents(),
+ "domAutomationController.send(window.showModalDialog !== undefined);",
+ &result));
+ EXPECT_TRUE(result);
+}
+
#endif // !defined(CHROME_OS)
} // namespace policy
« no previous file with comments | « chrome/browser/policy/configuration_policy_handler_list_factory.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698