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 <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 3819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3830 | 3830 |
3831 PrefService* prefs = browser()->profile()->GetPrefs(); | 3831 PrefService* prefs = browser()->profile()->GetPrefs(); |
3832 EXPECT_TRUE(extensions::MessageService::IsNativeMessagingHostAllowed( | 3832 EXPECT_TRUE(extensions::MessageService::IsNativeMessagingHostAllowed( |
3833 prefs, "host.name")); | 3833 prefs, "host.name")); |
3834 EXPECT_FALSE(extensions::MessageService::IsNativeMessagingHostAllowed( | 3834 EXPECT_FALSE(extensions::MessageService::IsNativeMessagingHostAllowed( |
3835 prefs, "other.host.name")); | 3835 prefs, "other.host.name")); |
3836 } | 3836 } |
3837 | 3837 |
3838 #endif // !defined(CHROME_OS) | 3838 #endif // !defined(CHROME_OS) |
3839 | 3839 |
| 3840 |
| 3841 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) |
| 3842 // Sets the hardware acceleration mode policy before the browser is started. |
| 3843 class HardwareAccelerationModePolicyTest : public PolicyTest { |
| 3844 public: |
| 3845 HardwareAccelerationModePolicyTest() {} |
| 3846 |
| 3847 void SetUpInProcessBrowserTestFixture() override { |
| 3848 PolicyTest::SetUpInProcessBrowserTestFixture(); |
| 3849 PolicyMap policies; |
| 3850 policies.Set(key::kHardwareAccelerationModeEnabled, |
| 3851 POLICY_LEVEL_MANDATORY, |
| 3852 POLICY_SCOPE_USER, |
| 3853 new base::FundamentalValue(false), |
| 3854 NULL); |
| 3855 provider_.UpdateChromePolicy(policies); |
| 3856 } |
| 3857 }; |
| 3858 |
| 3859 IN_PROC_BROWSER_TEST_F(HardwareAccelerationModePolicyTest, |
| 3860 HardwareAccelerationDisabled) { |
| 3861 // Verifies that hardware acceleration can be disabled with policy. |
| 3862 EXPECT_FALSE( |
| 3863 content::GpuDataManager::GetInstance()->GpuAccessAllowed(nullptr)); |
| 3864 } |
| 3865 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) |
| 3866 |
3840 } // namespace policy | 3867 } // namespace policy |
OLD | NEW |