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