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

Side by Side Diff: chrome/browser/policy/policy_browsertest.cc

Issue 964583002: Remove showModalDialog (Chrome side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 5 years, 9 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
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 3584 matching lines...) Expand 10 before | Expand all | Expand 10 after
3595 POLICY_SCOPE_USER, whitelist.DeepCopy(), NULL); 3595 POLICY_SCOPE_USER, whitelist.DeepCopy(), NULL);
3596 UpdateProviderPolicy(policies); 3596 UpdateProviderPolicy(policies);
3597 3597
3598 PrefService* prefs = browser()->profile()->GetPrefs(); 3598 PrefService* prefs = browser()->profile()->GetPrefs();
3599 EXPECT_TRUE(extensions::MessageService::IsNativeMessagingHostAllowed( 3599 EXPECT_TRUE(extensions::MessageService::IsNativeMessagingHostAllowed(
3600 prefs, "host.name")); 3600 prefs, "host.name"));
3601 EXPECT_FALSE(extensions::MessageService::IsNativeMessagingHostAllowed( 3601 EXPECT_FALSE(extensions::MessageService::IsNativeMessagingHostAllowed(
3602 prefs, "other.host.name")); 3602 prefs, "other.host.name"));
3603 } 3603 }
3604 3604
3605 IN_PROC_BROWSER_TEST_F(PolicyTest,
3606 EnableDeprecatedWebPlatformFeatures_ShowModalDialog) {
3607 base::ListValue enabled_features;
3608 enabled_features.Append(new base::StringValue(
3609 "ShowModalDialog_EffectiveUntil20150430"));
3610 PolicyMap policies;
3611 policies.Set(key::kEnableDeprecatedWebPlatformFeatures,
3612 POLICY_LEVEL_MANDATORY,
3613 POLICY_SCOPE_USER,
3614 enabled_features.DeepCopy(),
3615 NULL);
3616 UpdateProviderPolicy(policies);
3617
3618 // Policy only takes effect on new browsers, not existing browsers, so create
3619 // a new browser.
3620 Browser* browser2 = CreateBrowser(browser()->profile());
3621 ui_test_utils::NavigateToURL(browser2, GURL(url::kAboutBlankURL));
3622 bool result = false;
3623 EXPECT_TRUE(content::ExecuteScriptAndExtractBool(
3624 browser2->tab_strip_model()->GetActiveWebContents(),
3625 "domAutomationController.send(window.showModalDialog !== undefined);",
3626 &result));
3627 EXPECT_TRUE(result);
3628 }
3629
3630 #endif // !defined(CHROME_OS) 3605 #endif // !defined(CHROME_OS)
3631 3606
3632 } // namespace policy 3607 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/configuration_policy_handler_list_factory.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698