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

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

Powered by Google App Engine
This is Rietveld 408576698