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 <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 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 EXPECT_EQ(safe_search == 1, | 1199 EXPECT_EQ(safe_search == 1, |
1200 prefs->GetBoolean(prefs::kForceGoogleSafeSearch)); | 1200 prefs->GetBoolean(prefs::kForceGoogleSafeSearch)); |
1201 | 1201 |
1202 // Verify that safe search actually works. | 1202 // Verify that safe search actually works. |
1203 CheckSafeSearch(safe_search == 1); | 1203 CheckSafeSearch(safe_search == 1); |
1204 } | 1204 } |
1205 } | 1205 } |
1206 | 1206 |
1207 IN_PROC_BROWSER_TEST_F(PolicyTest, Disable3DAPIs) { | 1207 IN_PROC_BROWSER_TEST_F(PolicyTest, Disable3DAPIs) { |
1208 // This test assumes Gpu access. | 1208 // This test assumes Gpu access. |
1209 if (!content::GpuDataManager::GetInstance()->HardwareAccelerationEnabled()) | 1209 if (!content::GpuDataManager::GetInstance()->GpuAccessAllowed(NULL)) |
1210 return; | 1210 return; |
1211 | 1211 |
1212 ui_test_utils::NavigateToURL(browser(), GURL(url::kAboutBlankURL)); | 1212 ui_test_utils::NavigateToURL(browser(), GURL(url::kAboutBlankURL)); |
1213 // WebGL is enabled by default. | 1213 // WebGL is enabled by default. |
1214 content::WebContents* contents = | 1214 content::WebContents* contents = |
1215 browser()->tab_strip_model()->GetActiveWebContents(); | 1215 browser()->tab_strip_model()->GetActiveWebContents(); |
1216 EXPECT_TRUE(IsWebGLEnabled(contents)); | 1216 EXPECT_TRUE(IsWebGLEnabled(contents)); |
1217 // Disable with a policy. | 1217 // Disable with a policy. |
1218 PolicyMap policies; | 1218 PolicyMap policies; |
1219 policies.Set(key::kDisable3DAPIs, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, | 1219 policies.Set(key::kDisable3DAPIs, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, |
(...skipping 2910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4130 POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, | 4130 POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, |
4131 base::MakeUnique<base::Value>(false), nullptr); | 4131 base::MakeUnique<base::Value>(false), nullptr); |
4132 provider_.UpdateChromePolicy(policies); | 4132 provider_.UpdateChromePolicy(policies); |
4133 } | 4133 } |
4134 }; | 4134 }; |
4135 | 4135 |
4136 IN_PROC_BROWSER_TEST_F(HardwareAccelerationModePolicyTest, | 4136 IN_PROC_BROWSER_TEST_F(HardwareAccelerationModePolicyTest, |
4137 HardwareAccelerationDisabled) { | 4137 HardwareAccelerationDisabled) { |
4138 // Verifies that hardware acceleration can be disabled with policy. | 4138 // Verifies that hardware acceleration can be disabled with policy. |
4139 EXPECT_FALSE( | 4139 EXPECT_FALSE( |
4140 content::GpuDataManager::GetInstance()->HardwareAccelerationEnabled()); | 4140 content::GpuDataManager::GetInstance()->GpuAccessAllowed(nullptr)); |
4141 } | 4141 } |
4142 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) | 4142 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) |
4143 | 4143 |
4144 #if defined(OS_CHROMEOS) | 4144 #if defined(OS_CHROMEOS) |
4145 // Policy is only available in ChromeOS | 4145 // Policy is only available in ChromeOS |
4146 IN_PROC_BROWSER_TEST_F(PolicyTest, UnifiedDesktopEnabledByDefault) { | 4146 IN_PROC_BROWSER_TEST_F(PolicyTest, UnifiedDesktopEnabledByDefault) { |
4147 // Verify that Unified Desktop can be enabled by policy | 4147 // Verify that Unified Desktop can be enabled by policy |
4148 display::DisplayManager* display_manager = | 4148 display::DisplayManager* display_manager = |
4149 ash::Shell::GetInstance()->display_manager(); | 4149 ash::Shell::GetInstance()->display_manager(); |
4150 | 4150 |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4470 | 4470 |
4471 SetEmptyPolicy(); | 4471 SetEmptyPolicy(); |
4472 // Policy not set. | 4472 // Policy not set. |
4473 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); | 4473 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); |
4474 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); | 4474 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); |
4475 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); | 4475 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); |
4476 } | 4476 } |
4477 #endif // defined(OS_CHROMEOS) | 4477 #endif // defined(OS_CHROMEOS) |
4478 | 4478 |
4479 } // namespace policy | 4479 } // namespace policy |
OLD | NEW |