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

Side by Side Diff: chrome/browser/policy/policy_browsertest.cc

Issue 263423003: Add a policy to re-enable deprecated web platform features. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switch to WebPreferences, rebase. Created 6 years, 7 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 | Annotate | Revision Log
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 <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 2953 matching lines...) Expand 10 before | Expand all | Expand 10 after
2964 POLICY_SCOPE_USER, whitelist.DeepCopy(), NULL); 2964 POLICY_SCOPE_USER, whitelist.DeepCopy(), NULL);
2965 UpdateProviderPolicy(policies); 2965 UpdateProviderPolicy(policies);
2966 2966
2967 PrefService* prefs = browser()->profile()->GetPrefs(); 2967 PrefService* prefs = browser()->profile()->GetPrefs();
2968 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed( 2968 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed(
2969 prefs, "host.name")); 2969 prefs, "host.name"));
2970 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed( 2970 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed(
2971 prefs, "other.host.name")); 2971 prefs, "other.host.name"));
2972 } 2972 }
2973 2973
2974 IN_PROC_BROWSER_TEST_F(PolicyTest,
2975 EnableDeprecatedWebPlatformFeatures_ShowModalDialog) {
2976 base::ListValue enabled_features;
2977 enabled_features.Append(base::Value::CreateStringValue("ShowModalDialog"));
2978 PolicyMap policies;
2979 policies.Set(key::kEnableDeprecatedWebPlatformFeatures,
2980 POLICY_LEVEL_MANDATORY,
2981 POLICY_SCOPE_USER,
2982 enabled_features.DeepCopy(),
2983 NULL);
2984 UpdateProviderPolicy(policies);
2985
2986 ui_test_utils::NavigateToURL(browser(), GURL(content::kAboutBlankURL));
2987 bool result = false;
2988 EXPECT_TRUE(content::ExecuteScriptAndExtractBool(
2989 browser()->tab_strip_model()->GetActiveWebContents(),
2990 "domAutomationController.send(window.showModalDialog !== undefined);",
2991 &result));
2992 EXPECT_TRUE(result);
2993 }
2994
2974 #endif // !defined(CHROME_OS) 2995 #endif // !defined(CHROME_OS)
2975 2996
2976 } // namespace policy 2997 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698