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

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: Drop half of this CL. 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
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 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after
1328 // Enable with a policy. 1328 // Enable with a policy.
1329 policies.Set(key::kDisable3DAPIs, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, 1329 policies.Set(key::kDisable3DAPIs, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
1330 POLICY_SOURCE_CLOUD, 1330 POLICY_SOURCE_CLOUD,
1331 base::WrapUnique(new base::FundamentalValue(false)), nullptr); 1331 base::WrapUnique(new base::FundamentalValue(false)), nullptr);
1332 UpdateProviderPolicy(policies); 1332 UpdateProviderPolicy(policies);
1333 content::CrashTab(contents); 1333 content::CrashTab(contents);
1334 EXPECT_TRUE(chrome::ExecuteCommand(browser(), IDC_RELOAD)); 1334 EXPECT_TRUE(chrome::ExecuteCommand(browser(), IDC_RELOAD));
1335 EXPECT_TRUE(IsWebGLEnabled(contents)); 1335 EXPECT_TRUE(IsWebGLEnabled(contents));
1336 } 1336 }
1337 1337
1338 IN_PROC_BROWSER_TEST_F(PolicyTest, DisableSpdy) {
1339 // Verifies that SPDY can be disable by policy.
1340 EXPECT_TRUE(net::HttpStreamFactory::spdy_enabled());
1341 PolicyMap policies;
1342 policies.Set(key::kDisableSpdy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
1343 POLICY_SOURCE_CLOUD,
1344 base::WrapUnique(new base::FundamentalValue(true)), nullptr);
1345 UpdateProviderPolicy(policies);
1346 content::RunAllPendingInMessageLoop();
1347 EXPECT_FALSE(net::HttpStreamFactory::spdy_enabled());
1348 // Verify that it can be force-enabled too.
1349 browser()->profile()->GetPrefs()->SetBoolean(prefs::kDisableSpdy, true);
1350 policies.Set(key::kDisableSpdy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
1351 POLICY_SOURCE_CLOUD,
1352 base::WrapUnique(new base::FundamentalValue(false)), nullptr);
1353 UpdateProviderPolicy(policies);
1354 content::RunAllPendingInMessageLoop();
1355 EXPECT_TRUE(net::HttpStreamFactory::spdy_enabled());
1356 }
1357
1358 namespace { 1338 namespace {
1359 1339
1360 // The following helpers retrieve whether https:// URL stripping is 1340 // The following helpers retrieve whether https:// URL stripping is
1361 // enabled for PAC scripts. It needs to run on the IO thread. 1341 // enabled for PAC scripts. It needs to run on the IO thread.
1362 void GetPacHttpsUrlStrippingEnabledOnIOThread(IOThread* io_thread, 1342 void GetPacHttpsUrlStrippingEnabledOnIOThread(IOThread* io_thread,
1363 bool* enabled) { 1343 bool* enabled) {
1364 *enabled = io_thread->PacHttpsUrlStrippingEnabled(); 1344 *enabled = io_thread->PacHttpsUrlStrippingEnabled();
1365 } 1345 }
1366 1346
1367 bool GetPacHttpsUrlStrippingEnabled() { 1347 bool GetPacHttpsUrlStrippingEnabled() {
(...skipping 2739 matching lines...) Expand 10 before | Expand all | Expand 10 after
4107 4087
4108 SetEmptyPolicy(); 4088 SetEmptyPolicy();
4109 // Policy not set. 4089 // Policy not set.
4110 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); 4090 CheckSystemTimezoneAutomaticDetectionPolicyUnset();
4111 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); 4091 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false));
4112 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); 4092 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests());
4113 } 4093 }
4114 #endif // defined(OS_CHROMEOS) 4094 #endif // defined(OS_CHROMEOS)
4115 4095
4116 } // namespace policy 4096 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698