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

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: Addressed review feedback. 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 4aa99d54e015c7240e8bdc0e96f573b16144fdaf..bd0fd51de3a50c7e5843fee3f843c01cb998078c 100644
--- a/chrome/browser/policy/policy_browsertest.cc
+++ b/chrome/browser/policy/policy_browsertest.cc
@@ -2979,6 +2979,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)
Joao da Silva 2014/06/19 09:11:45 The new test should be enabled on OS_CHROMEOS too
} // 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