Index: chrome/browser/policy/policy_browsertest.cc |
diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc |
index a4b6255b1ef72610ff12afe4b15d228016dbd7cd..c6ba1946db5f1016a296f630b74f25cd8400951e 100644 |
--- a/chrome/browser/policy/policy_browsertest.cc |
+++ b/chrome/browser/policy/policy_browsertest.cc |
@@ -3837,4 +3837,32 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, NativeMessagingWhitelist) { |
#endif // !defined(CHROME_OS) |
+// Sets the hardware acceleration mode policy before the browser is started. |
+class HardwareAccelerationModePolicyTest : public PolicyTest { |
+ public: |
+ HardwareAccelerationModePolicyTest() {} |
+ ~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.
|
+ |
+ void SetUpInProcessBrowserTestFixture() override { |
+ PolicyTest::SetUpInProcessBrowserTestFixture(); |
+ PolicyMap policies; |
+ policies.Set(key::kHardwareAccelerationModeEnabled, |
+ POLICY_LEVEL_MANDATORY, |
+ POLICY_SCOPE_USER, |
+ new base::FundamentalValue(false), |
+ NULL); |
+ provider_.UpdateChromePolicy(policies); |
+ } |
+}; |
+ |
+IN_PROC_BROWSER_TEST_F(PolicyTest, HardwareAccelerationEnabledByDefault) { |
+ 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
|
+} |
+ |
+IN_PROC_BROWSER_TEST_F(HardwareAccelerationModePolicyTest, |
+ HardwareAccelerationDisabled) { |
+ // Verifies that hardware acceleration can be disabled with policy. |
+ EXPECT_FALSE(content::GpuDataManager::GetInstance()->GpuAccessAllowed(NULL)); |
+} |
+ |
} // namespace policy |