Backed out changeset 18f07982ab28 (bug 1600007) for failing at browser_policy_bookmarks.js on a CLOSED TREE.

This commit is contained in:
Gurzau Raul 2019-12-04 02:32:38 +02:00
parent 9510cd391a
commit 558a79c450
4 changed files with 3 additions and 36 deletions

View File

@ -1,18 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
add_task(async function test_empty_policy() {
await setupPolicyEngineWithJson({
policies: {
Certificates: {},
},
});
equal(
Services.policies.status,
Ci.nsIEnterprisePolicies.INACTIVE,
"Engine is not active"
);
});

View File

@ -8,7 +8,6 @@ support-files =
[test_appupdateurl.js]
[test_clear_blocked_cookies.js]
[test_defaultbrowsercheck.js]
[test_empty_policy.js]
[test_extensions.js]
[test_extensionsettings.js]
[test_macosparser_unflatten.js]

View File

@ -58,20 +58,6 @@ let env = Cc["@mozilla.org/process/environment;1"].getService(
);
const isXpcshell = env.exists("XPCSHELL_TEST_PROFILE_DIR");
// We're only testing for empty objects, not
// empty strings.
function isEmptyObject(obj) {
if (Object.keys(obj).length === 0) {
return true;
}
for (let key of Object.keys(obj)) {
if (typeof obj[key] !== "object" || !isEmptyObject(obj[key])) {
return false;
}
}
return true;
}
function EnterprisePoliciesManager() {
Services.obs.addObserver(this, "profile-after-change", true);
Services.obs.addObserver(this, "final-ui-startup", true);
@ -457,7 +443,7 @@ class JSONPoliciesProvider {
get hasPolicies() {
return (
this._failed ||
(this._policies !== null && !isEmptyObject(this._policies))
(this._policies !== null && Object.keys(this._policies).length)
);
}
@ -568,7 +554,7 @@ class WindowsGPOPoliciesProvider {
}
get hasPolicies() {
return this._policies !== null && !isEmptyObject(this._policies);
return this._policies !== null && Object.keys(this._policies).length;
}
get policies() {

View File

@ -3,7 +3,7 @@
"use strict";
add_task(async function test_empty_toplevel() {
add_task(async function test_app_update_URL() {
await setupPolicyEngineWithJson({
policies: {},
});