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

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: 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 2956 matching lines...) Expand 10 before | Expand all | Expand 10 after
2967 POLICY_SCOPE_USER, whitelist.DeepCopy(), NULL); 2967 POLICY_SCOPE_USER, whitelist.DeepCopy(), NULL);
2968 UpdateProviderPolicy(policies); 2968 UpdateProviderPolicy(policies);
2969 2969
2970 PrefService* prefs = browser()->profile()->GetPrefs(); 2970 PrefService* prefs = browser()->profile()->GetPrefs();
2971 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed( 2971 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed(
2972 prefs, "host.name")); 2972 prefs, "host.name"));
2973 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed( 2973 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed(
2974 prefs, "other.host.name")); 2974 prefs, "other.host.name"));
2975 } 2975 }
2976 2976
2977 IN_PROC_BROWSER_TEST_F(PolicyTest,
2978 EnableDeprecatedWebPlatformFeatures_ShowModalDialog) {
2979 base::ListValue enabled_features;
2980 enabled_features.Append(base::Value::CreateStringValue("ShowModalDialog"));
2981 PolicyMap policies;
2982 policies.Set(key::kEnableDeprecatedWebPlatformFeatures,
2983 POLICY_LEVEL_MANDATORY,
2984 POLICY_SCOPE_USER,
2985 enabled_features.DeepCopy(),
2986 NULL);
2987 UpdateProviderPolicy(policies);
2988
2989 ui_test_utils::NavigateToURL(browser(), GURL(content::kAboutBlankURL));
2990 bool result = false;
2991 EXPECT_TRUE(content::ExecuteScriptAndExtractBool(
2992 browser()->tab_strip_model()->GetActiveWebContents(),
2993 "domAutomationController.send(window.showModalDialog !== undefined);",
2994 &result));
2995 EXPECT_TRUE(result);
2996 }
2997
2977 #endif // !defined(CHROME_OS) 2998 #endif // !defined(CHROME_OS)
2978 2999
2979 } // namespace policy 3000 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698