Chromium Code Reviews| 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 // Sets the hardware acceleration mode policy before the browser is started. | |
| 3841 class HardwareAccelerationModePolicyTest : public PolicyTest { | |
| 3842 public: | |
| 3843 HardwareAccelerationModePolicyTest() {} | |
| 3844 ~HardwareAccelerationModePolicyTest() override {} | |
|
bartfab (slow)
2015/07/01 09:16:54
Nit: No need to override the destructor here.
Zhenyao Mo
2015/07/01 17:56:07
Done.
| |
| 3845 | |
| 3846 void SetUpInProcessBrowserTestFixture() override { | |
| 3847 PolicyTest::SetUpInProcessBrowserTestFixture(); | |
| 3848 PolicyMap policies; | |
| 3849 policies.Set(key::kHardwareAccelerationModeEnabled, | |
| 3850 POLICY_LEVEL_MANDATORY, | |
| 3851 POLICY_SCOPE_USER, | |
| 3852 new base::FundamentalValue(false), | |
| 3853 NULL); | |
| 3854 provider_.UpdateChromePolicy(policies); | |
| 3855 } | |
| 3856 }; | |
| 3857 | |
| 3858 IN_PROC_BROWSER_TEST_F(PolicyTest, HardwareAccelerationEnabledByDefault) { | |
| 3859 EXPECT_TRUE(content::GpuDataManager::GetInstance()->GpuAccessAllowed(NULL)); | |
|
bartfab (slow)
2015/07/01 09:16:54
1: Nit: s/NULL/nullptr/
2: PolicyTest.Disable3DAPI
Zhenyao Mo
2015/07/01 17:56:07
Although it seems to run OK on all try bots, but I
| |
| 3860 } | |
| 3861 | |
| 3862 IN_PROC_BROWSER_TEST_F(HardwareAccelerationModePolicyTest, | |
| 3863 HardwareAccelerationDisabled) { | |
| 3864 // Verifies that hardware acceleration can be disabled with policy. | |
| 3865 EXPECT_FALSE(content::GpuDataManager::GetInstance()->GpuAccessAllowed(NULL)); | |
| 3866 } | |
| 3867 | |
| 3840 } // namespace policy | 3868 } // namespace policy |
| OLD | NEW |