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

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

Issue 2140733002: Remove HttpStreamFactory::spdy_enabled_ static member and accessors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 5 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
« no previous file with comments | « chrome/browser/net/net_pref_observer.cc ('k') | chrome/common/pref_names.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 1320 matching lines...) Expand 10 before | Expand all | Expand 10 after
1331 // Enable with a policy. 1331 // Enable with a policy.
1332 policies.Set(key::kDisable3DAPIs, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, 1332 policies.Set(key::kDisable3DAPIs, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
1333 POLICY_SOURCE_CLOUD, 1333 POLICY_SOURCE_CLOUD,
1334 base::WrapUnique(new base::FundamentalValue(false)), nullptr); 1334 base::WrapUnique(new base::FundamentalValue(false)), nullptr);
1335 UpdateProviderPolicy(policies); 1335 UpdateProviderPolicy(policies);
1336 content::CrashTab(contents); 1336 content::CrashTab(contents);
1337 EXPECT_TRUE(chrome::ExecuteCommand(browser(), IDC_RELOAD)); 1337 EXPECT_TRUE(chrome::ExecuteCommand(browser(), IDC_RELOAD));
1338 EXPECT_TRUE(IsWebGLEnabled(contents)); 1338 EXPECT_TRUE(IsWebGLEnabled(contents));
1339 } 1339 }
1340 1340
1341 IN_PROC_BROWSER_TEST_F(PolicyTest, DisableSpdy) {
1342 // Verifies that SPDY can be disable by policy.
1343 EXPECT_TRUE(net::HttpStreamFactory::spdy_enabled());
1344 PolicyMap policies;
1345 policies.Set(key::kDisableSpdy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
1346 POLICY_SOURCE_CLOUD,
1347 base::WrapUnique(new base::FundamentalValue(true)), nullptr);
1348 UpdateProviderPolicy(policies);
1349 content::RunAllPendingInMessageLoop();
1350 EXPECT_FALSE(net::HttpStreamFactory::spdy_enabled());
1351 // Verify that it can be force-enabled too.
1352 browser()->profile()->GetPrefs()->SetBoolean(prefs::kDisableSpdy, true);
1353 policies.Set(key::kDisableSpdy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
1354 POLICY_SOURCE_CLOUD,
1355 base::WrapUnique(new base::FundamentalValue(false)), nullptr);
1356 UpdateProviderPolicy(policies);
1357 content::RunAllPendingInMessageLoop();
1358 EXPECT_TRUE(net::HttpStreamFactory::spdy_enabled());
1359 }
1360
1361 namespace { 1341 namespace {
1362 1342
1363 // The following helpers retrieve whether https:// URL stripping is 1343 // The following helpers retrieve whether https:// URL stripping is
1364 // enabled for PAC scripts. It needs to run on the IO thread. 1344 // enabled for PAC scripts. It needs to run on the IO thread.
1365 void GetPacHttpsUrlStrippingEnabledOnIOThread(IOThread* io_thread, 1345 void GetPacHttpsUrlStrippingEnabledOnIOThread(IOThread* io_thread,
1366 bool* enabled) { 1346 bool* enabled) {
1367 *enabled = io_thread->PacHttpsUrlStrippingEnabled(); 1347 *enabled = io_thread->PacHttpsUrlStrippingEnabled();
1368 } 1348 }
1369 1349
1370 bool GetPacHttpsUrlStrippingEnabled() { 1350 bool GetPacHttpsUrlStrippingEnabled() {
(...skipping 2739 matching lines...) Expand 10 before | Expand all | Expand 10 after
4110 4090
4111 SetEmptyPolicy(); 4091 SetEmptyPolicy();
4112 // Policy not set. 4092 // Policy not set.
4113 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); 4093 CheckSystemTimezoneAutomaticDetectionPolicyUnset();
4114 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); 4094 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false));
4115 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); 4095 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests());
4116 } 4096 }
4117 #endif // defined(OS_CHROMEOS) 4097 #endif // defined(OS_CHROMEOS)
4118 4098
4119 } // namespace policy 4099 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/net/net_pref_observer.cc ('k') | chrome/common/pref_names.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698