Bug 1452740 - Added Policy: Disable Hardware Acceleration r=Felipe

MozReview-Commit-ID: FVrpCRtwQLh

--HG--
extra : rebase_source : ae6ec66f11537b46b0631b195f148ffea580971f
This commit is contained in:
kanika 2018-05-15 20:22:39 +05:30
parent 4e3daa47c1
commit 776c97f433
6 changed files with 39 additions and 0 deletions

View File

@ -495,6 +495,14 @@ var Policies = {
}
},
"HardwareAcceleration": {
onBeforeAddons(manager, param) {
if (!param) {
setAndLockPref("layers.acceleration.disabled", true);
}
}
},
"Homepage": {
onBeforeUIStartup(manager, param) {
// |homepages| will be a string containing a pipe-separated ('|') list of

View File

@ -382,6 +382,13 @@
}
},
"HardwareAcceleration": {
"description": "If false, prevents ability to turn on hardware acceleration.",
"first_available": "60.0",
"type": "boolean"
},
"Homepage": {
"description": "Set and optionally lock the homepage.",
"first_available": "60.0",

View File

@ -0,0 +1,7 @@
[DEFAULT]
prefs =
browser.policies.alternatePath='<test-root>/browser/components/enterprisepolicies/tests/browser/hardware_acceleration/disable_hardware_acceleration.json'
support-files =
disable_hardware_acceleration.json
[browser_policy_hardware_acceleration.js]

View File

@ -0,0 +1,11 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
add_task(async function test_policy_hardware_acceleration() {
let winUtils = Services.wm.getMostRecentWindow("").
QueryInterface(Ci.nsIInterfaceRequestor).
getInterface(Ci.nsIDOMWindowUtils);
is(winUtils.layerManagerType, "Basic", "Hardware acceleration disabled");
});

View File

@ -0,0 +1,5 @@
{
"policies": {
"HardwareAcceleration": false
}
}

View File

@ -11,6 +11,7 @@ BROWSER_CHROME_MANIFESTS += [
'browser/disable_developer_tools/browser.ini',
'browser/disable_forget_button/browser.ini',
'browser/disable_fxscreenshots/browser.ini',
'browser/hardware_acceleration/browser.ini',
]
TESTING_JS_MODULES += [