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

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

Issue 10911198: SPDY - disable SPDY based on command line and policy (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 634
635 IN_PROC_BROWSER_TEST_F(PolicyTest, DisableSpdy) { 635 IN_PROC_BROWSER_TEST_F(PolicyTest, DisableSpdy) {
636 // Verifies that SPDY can be disable by policy. 636 // Verifies that SPDY can be disable by policy.
637 EXPECT_TRUE(net::HttpStreamFactory::spdy_enabled()); 637 EXPECT_TRUE(net::HttpStreamFactory::spdy_enabled());
638 PolicyMap policies; 638 PolicyMap policies;
639 policies.Set(key::kDisableSpdy, POLICY_LEVEL_MANDATORY, 639 policies.Set(key::kDisableSpdy, POLICY_LEVEL_MANDATORY,
640 POLICY_SCOPE_USER, base::Value::CreateBooleanValue(true)); 640 POLICY_SCOPE_USER, base::Value::CreateBooleanValue(true));
641 provider_.UpdateChromePolicy(policies); 641 provider_.UpdateChromePolicy(policies);
642 content::RunAllPendingInMessageLoop(); 642 content::RunAllPendingInMessageLoop();
643 EXPECT_FALSE(net::HttpStreamFactory::spdy_enabled()); 643 EXPECT_FALSE(net::HttpStreamFactory::spdy_enabled());
644 // Verify that it can be force-enabled too. 644 // If SPDY is disabled (because of command line option), then verify policy
645 // doesn't enable it.
645 browser()->profile()->GetPrefs()->SetBoolean(prefs::kDisableSpdy, true); 646 browser()->profile()->GetPrefs()->SetBoolean(prefs::kDisableSpdy, true);
646 policies.Set(key::kDisableSpdy, POLICY_LEVEL_MANDATORY, 647 policies.Set(key::kDisableSpdy, POLICY_LEVEL_MANDATORY,
647 POLICY_SCOPE_USER, base::Value::CreateBooleanValue(false)); 648 POLICY_SCOPE_USER, base::Value::CreateBooleanValue(false));
648 provider_.UpdateChromePolicy(policies); 649 provider_.UpdateChromePolicy(policies);
649 content::RunAllPendingInMessageLoop(); 650 content::RunAllPendingInMessageLoop();
650 EXPECT_TRUE(net::HttpStreamFactory::spdy_enabled()); 651 EXPECT_FALSE(net::HttpStreamFactory::spdy_enabled());
651 } 652 }
652 653
653 IN_PROC_BROWSER_TEST_F(PolicyTest, DisabledPlugins) { 654 IN_PROC_BROWSER_TEST_F(PolicyTest, DisabledPlugins) {
654 // Verifies that plugins can be forced to be disabled by policy. 655 // Verifies that plugins can be forced to be disabled by policy.
655 656
656 // Verify that the Flash plugin exists and that it can be enabled and disabled 657 // Verify that the Flash plugin exists and that it can be enabled and disabled
657 // by the user. 658 // by the user.
658 std::vector<webkit::WebPluginInfo> plugins; 659 std::vector<webkit::WebPluginInfo> plugins;
659 GetPluginList(&plugins); 660 GetPluginList(&plugins);
660 const webkit::WebPluginInfo* flash = GetFlashPlugin(plugins); 661 const webkit::WebPluginInfo* flash = GetFlashPlugin(plugins);
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
1329 INSTANTIATE_TEST_CASE_P( 1330 INSTANTIATE_TEST_CASE_P(
1330 RestoreOnStartupPolicyTestInstance, 1331 RestoreOnStartupPolicyTestInstance,
1331 RestoreOnStartupPolicyTest, 1332 RestoreOnStartupPolicyTest,
1332 testing::Values(&RestoreOnStartupPolicyTest::HomepageIsNotNTP, 1333 testing::Values(&RestoreOnStartupPolicyTest::HomepageIsNotNTP,
1333 &RestoreOnStartupPolicyTest::HomepageIsNTP, 1334 &RestoreOnStartupPolicyTest::HomepageIsNTP,
1334 &RestoreOnStartupPolicyTest::ListOfURLs, 1335 &RestoreOnStartupPolicyTest::ListOfURLs,
1335 &RestoreOnStartupPolicyTest::NTP, 1336 &RestoreOnStartupPolicyTest::NTP,
1336 &RestoreOnStartupPolicyTest::Last)); 1337 &RestoreOnStartupPolicyTest::Last));
1337 1338
1338 } // namespace policy 1339 } // namespace policy
OLDNEW
« chrome/browser/net/net_pref_observer.cc ('K') | « chrome/browser/net/net_pref_observer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698