OLD | NEW |
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 Loading... |
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) |
2983 | 3008 |
2984 } // namespace policy | 3009 } // namespace policy |
OLD | NEW |