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 2997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3008 POLICY_SCOPE_USER, whitelist.DeepCopy(), NULL); | 3008 POLICY_SCOPE_USER, whitelist.DeepCopy(), NULL); |
3009 UpdateProviderPolicy(policies); | 3009 UpdateProviderPolicy(policies); |
3010 | 3010 |
3011 PrefService* prefs = browser()->profile()->GetPrefs(); | 3011 PrefService* prefs = browser()->profile()->GetPrefs(); |
3012 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed( | 3012 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed( |
3013 prefs, "host.name")); | 3013 prefs, "host.name")); |
3014 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed( | 3014 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed( |
3015 prefs, "other.host.name")); | 3015 prefs, "other.host.name")); |
3016 } | 3016 } |
3017 | 3017 |
| 3018 IN_PROC_BROWSER_TEST_F(PolicyTest, |
| 3019 EnableDeprecatedWebPlatformFeatures_ShowModalDialog) { |
| 3020 base::ListValue enabled_features; |
| 3021 enabled_features.Append(new base::StringValue( |
| 3022 "ShowModalDialog_EffectiveUntil20150430")); |
| 3023 PolicyMap policies; |
| 3024 policies.Set(key::kEnableDeprecatedWebPlatformFeatures, |
| 3025 POLICY_LEVEL_MANDATORY, |
| 3026 POLICY_SCOPE_USER, |
| 3027 enabled_features.DeepCopy(), |
| 3028 NULL); |
| 3029 UpdateProviderPolicy(policies); |
| 3030 |
| 3031 // Policy only takes effect on new browsers, not existing browsers, so create |
| 3032 // a new browser. |
| 3033 Browser* browser2 = CreateBrowser(browser()->profile()); |
| 3034 ui_test_utils::NavigateToURL(browser2, GURL(url::kAboutBlankURL)); |
| 3035 bool result = false; |
| 3036 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( |
| 3037 browser2->tab_strip_model()->GetActiveWebContents(), |
| 3038 "domAutomationController.send(window.showModalDialog !== undefined);", |
| 3039 &result)); |
| 3040 EXPECT_TRUE(result); |
| 3041 } |
| 3042 |
3018 #endif // !defined(CHROME_OS) | 3043 #endif // !defined(CHROME_OS) |
3019 | 3044 |
3020 } // namespace policy | 3045 } // namespace policy |
OLD | NEW |