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

Side by Side 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 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 2961 matching lines...) Expand 10 before | Expand all | Expand 10 after
2972 POLICY_SCOPE_USER, whitelist.DeepCopy(), NULL); 2972 POLICY_SCOPE_USER, whitelist.DeepCopy(), NULL);
2973 UpdateProviderPolicy(policies); 2973 UpdateProviderPolicy(policies);
2974 2974
2975 PrefService* prefs = browser()->profile()->GetPrefs(); 2975 PrefService* prefs = browser()->profile()->GetPrefs();
2976 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed( 2976 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed(
2977 prefs, "host.name")); 2977 prefs, "host.name"));
2978 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed( 2978 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed(
2979 prefs, "other.host.name")); 2979 prefs, "other.host.name"));
2980 } 2980 }
2981 2981
2982 IN_PROC_BROWSER_TEST_F(PolicyTest,
2983 EnableDeprecatedWebPlatformFeatures_ShowModalDialog) {
2984 base::ListValue enabled_features;
2985 enabled_features.Append(new base::StringValue(
2986 "ShowModalDialog_EffectiveUntil20150430"));
2987 PolicyMap policies;
2988 policies.Set(key::kEnableDeprecatedWebPlatformFeatures,
2989 POLICY_LEVEL_MANDATORY,
2990 POLICY_SCOPE_USER,
2991 enabled_features.DeepCopy(),
2992 NULL);
2993 UpdateProviderPolicy(policies);
2994
2995 // Policy only takes effect on new browsers, not existing browsers, so create
2996 // a new browser.
2997 Browser* browser2 = CreateBrowser(browser()->profile());
2998 ui_test_utils::NavigateToURL(browser2, GURL(url::kAboutBlankURL));
2999 bool result = false;
3000 EXPECT_TRUE(content::ExecuteScriptAndExtractBool(
3001 browser2->tab_strip_model()->GetActiveWebContents(),
3002 "domAutomationController.send(window.showModalDialog !== undefined);",
3003 &result));
3004 EXPECT_TRUE(result);
3005 }
3006
2982 #endif // !defined(CHROME_OS) 3007 #endif // !defined(CHROME_OS)
Joao da Silva 2014/06/19 09:11:45 The new test should be enabled on OS_CHROMEOS too
2983 3008
2984 } // namespace policy 3009 } // namespace policy
OLDNEW
« 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