зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 28b3bd8e5018 (bug 1482809) for using the wrong author.
--HG-- rename : toolkit/components/enterprisepolicies/EnterprisePolicies.js => browser/components/enterprisepolicies/EnterprisePolicies.js rename : toolkit/components/enterprisepolicies/EnterprisePolicies.manifest => browser/components/enterprisepolicies/EnterprisePolicies.manifest rename : toolkit/components/enterprisepolicies/EnterprisePoliciesContent.js => browser/components/enterprisepolicies/EnterprisePoliciesContent.js rename : toolkit/components/enterprisepolicies/WindowsGPOParser.jsm => browser/components/enterprisepolicies/WindowsGPOParser.jsm rename : toolkit/components/enterprisepolicies/macOSPoliciesParser.jsm => browser/components/enterprisepolicies/macOSPoliciesParser.jsm rename : toolkit/components/enterprisepolicies/tests/EnterprisePolicyTesting.jsm => browser/components/enterprisepolicies/tests/EnterprisePolicyTesting.jsm rename : toolkit/components/enterprisepolicies/tests/browser/browser_policies_basic_tests.js => browser/components/enterprisepolicies/tests/browser/browser_policies_basic_tests.js rename : toolkit/components/enterprisepolicies/tests/browser/browser_policies_broken_json.js => browser/components/enterprisepolicies/tests/browser/browser_policies_broken_json.js rename : toolkit/components/enterprisepolicies/tests/browser/browser_policies_enterprise_only.js => browser/components/enterprisepolicies/tests/browser/browser_policies_enterprise_only.js rename : toolkit/components/enterprisepolicies/tests/browser/browser_policies_mistyped_json.js => browser/components/enterprisepolicies/tests/browser/browser_policies_mistyped_json.js rename : toolkit/components/enterprisepolicies/tests/browser/config_broken_json.json => browser/components/enterprisepolicies/tests/browser/config_broken_json.json
This commit is contained in:
Родитель
2a531fdb64
Коммит
f1e0f0ddf1
|
@ -7,8 +7,8 @@ const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
|||
const {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
WindowsGPOParser: "resource://gre/modules/policies/WindowsGPOParser.jsm",
|
||||
macOSPoliciesParser: "resource://gre/modules/policies/macOSPoliciesParser.jsm",
|
||||
WindowsGPOParser: "resource:///modules/policies/WindowsGPOParser.jsm",
|
||||
macOSPoliciesParser: "resource:///modules/policies/macOSPoliciesParser.jsm",
|
||||
Policies: "resource:///modules/policies/Policies.jsm",
|
||||
JsonSchemaValidator: "resource://gre/modules/components-utils/JsonSchemaValidator.jsm",
|
||||
});
|
||||
|
@ -468,7 +468,7 @@ class WindowsGPOPoliciesProvider {
|
|||
|
||||
_readData(wrk, root) {
|
||||
wrk.open(root, "SOFTWARE\\Policies", wrk.ACCESS_READ);
|
||||
if (wrk.hasChild("Mozilla\\" + Services.appinfo.name)) {
|
||||
if (wrk.hasChild("Mozilla\\Firefox")) {
|
||||
this._policies = WindowsGPOParser.readPolicies(wrk, this._policies);
|
||||
}
|
||||
wrk.close();
|
|
@ -0,0 +1,5 @@
|
|||
component {ea4e1414-779b-458b-9d1f-d18e8efbc145} EnterprisePolicies.js process=main
|
||||
contract @mozilla.org/browser/enterprisepolicies;1 {ea4e1414-779b-458b-9d1f-d18e8efbc145} process=main
|
||||
|
||||
component {dc6358f8-d167-4566-bf5b-4350b5e6a7a2} EnterprisePoliciesContent.js process=content
|
||||
contract @mozilla.org/browser/enterprisepolicies;1 {dc6358f8-d167-4566-bf5b-4350b5e6a7a2} process=content
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
const PREF_LOGLEVEL = "browser.policies.loglevel";
|
||||
|
@ -24,7 +23,7 @@ var EXPORTED_SYMBOLS = ["WindowsGPOParser"];
|
|||
|
||||
var WindowsGPOParser = {
|
||||
readPolicies(wrk, policies) {
|
||||
let childWrk = wrk.openChild("Mozilla\\" + Services.appinfo.name, wrk.ACCESS_READ);
|
||||
let childWrk = wrk.openChild("Mozilla\\Firefox", wrk.ACCESS_READ);
|
||||
if (!policies) {
|
||||
policies = {};
|
||||
}
|
|
@ -16,10 +16,26 @@ TEST_DIRS += [
|
|||
'tests'
|
||||
]
|
||||
|
||||
EXTRA_COMPONENTS += [
|
||||
'EnterprisePolicies.js',
|
||||
'EnterprisePolicies.manifest',
|
||||
'EnterprisePoliciesContent.js',
|
||||
]
|
||||
|
||||
EXTRA_JS_MODULES.policies += [
|
||||
'Policies.jsm',
|
||||
]
|
||||
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
||||
EXTRA_JS_MODULES.policies += [
|
||||
'WindowsGPOParser.jsm',
|
||||
]
|
||||
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
|
||||
EXTRA_JS_MODULES.policies += [
|
||||
'macOSPoliciesParser.jsm',
|
||||
]
|
||||
|
||||
FINAL_LIBRARY = 'browsercomps'
|
||||
|
||||
JAR_MANIFESTS += ['jar.mn']
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
support-files =
|
||||
head.js
|
||||
config_popups_cookies_addons_flash.json
|
||||
config_broken_json.json
|
||||
opensearch.html
|
||||
opensearchEngine.xml
|
||||
policytest_v0.1.xpi
|
||||
|
@ -11,9 +12,13 @@ support-files =
|
|||
../../../../../toolkit/components/antitracking/test/browser/page.html
|
||||
../../../../../toolkit/components/antitracking/test/browser/subResources.sjs
|
||||
|
||||
[browser_policies_basic_tests.js]
|
||||
[browser_policies_broken_json.js]
|
||||
[browser_policies_enterprise_only.js]
|
||||
[browser_policies_getActivePolicies.js]
|
||||
[browser_policies_macosparser_unflatten.js]
|
||||
skip-if = os != 'mac'
|
||||
[browser_policies_mistyped_json.js]
|
||||
[browser_policies_notice_in_aboutpreferences.js]
|
||||
[browser_policies_popups_cookies_addons_flash.js]
|
||||
[browser_policies_runOnce_helper.js]
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
let { macOSPoliciesParser } = ChromeUtils.import("resource://gre/modules/policies/macOSPoliciesParser.jsm");
|
||||
let { macOSPoliciesParser } = ChromeUtils.import("resource:///modules/policies/macOSPoliciesParser.jsm");
|
||||
|
||||
add_task(async function test_object_unflatten() {
|
||||
// Note: these policies are just examples and they won't actually
|
||||
|
|
|
@ -13,3 +13,7 @@ BROWSER_CHROME_MANIFESTS += [
|
|||
'browser/disable_fxscreenshots/browser.ini',
|
||||
'browser/hardware_acceleration/browser.ini',
|
||||
]
|
||||
|
||||
TESTING_JS_MODULES += [
|
||||
'EnterprisePolicyTesting.jsm',
|
||||
]
|
||||
|
|
|
@ -165,9 +165,9 @@
|
|||
|
||||
; JavaScript components
|
||||
@RESPATH@/browser/components/BrowserComponents.manifest
|
||||
@RESPATH@/components/EnterprisePolicies.js
|
||||
@RESPATH@/components/EnterprisePoliciesContent.js
|
||||
@RESPATH@/components/EnterprisePolicies.manifest
|
||||
@RESPATH@/browser/components/EnterprisePolicies.js
|
||||
@RESPATH@/browser/components/EnterprisePoliciesContent.js
|
||||
@RESPATH@/browser/components/EnterprisePolicies.manifest
|
||||
@RESPATH@/components/toolkitsearch.manifest
|
||||
@RESPATH@/components/extensions.manifest
|
||||
#ifdef MOZ_UPDATER
|
||||
|
|
|
@ -183,7 +183,7 @@ nsAboutProtocolHandler::NewChannel(nsIURI *uri, nsILoadInfo *aLoadInfo,
|
|||
!path.EqualsLiteral("newtab") &&
|
||||
!path.EqualsLiteral("certerror")) {
|
||||
nsCOMPtr<nsIEnterprisePolicies> policyManager =
|
||||
do_GetService("@mozilla.org/enterprisepolicies;1", &rv2);
|
||||
do_GetService("@mozilla.org/browser/enterprisepolicies;1", &rv2);
|
||||
if (NS_SUCCEEDED(rv2)) {
|
||||
nsAutoCString normalizedURL;
|
||||
normalizedURL.AssignLiteral("about:");
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
component {ea4e1414-779b-458b-9d1f-d18e8efbc145} EnterprisePolicies.js process=main
|
||||
contract @mozilla.org/enterprisepolicies;1 {ea4e1414-779b-458b-9d1f-d18e8efbc145} process=main
|
||||
|
||||
component {dc6358f8-d167-4566-bf5b-4350b5e6a7a2} EnterprisePoliciesContent.js process=content
|
||||
contract @mozilla.org/enterprisepolicies;1 {dc6358f8-d167-4566-bf5b-4350b5e6a7a2} process=content
|
|
@ -12,24 +12,3 @@ XPIDL_SOURCES += [
|
|||
]
|
||||
|
||||
XPIDL_MODULE = 'enterprisepolicies'
|
||||
|
||||
TEST_DIRS += [
|
||||
'tests'
|
||||
]
|
||||
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] != "android":
|
||||
EXTRA_COMPONENTS += [
|
||||
'EnterprisePolicies.js',
|
||||
'EnterprisePolicies.manifest',
|
||||
'EnterprisePoliciesContent.js',
|
||||
]
|
||||
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
||||
EXTRA_JS_MODULES.policies += [
|
||||
'WindowsGPOParser.jsm',
|
||||
]
|
||||
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
|
||||
EXTRA_JS_MODULES.policies += [
|
||||
'macOSPoliciesParser.jsm',
|
||||
]
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
[DEFAULT]
|
||||
head = head.js
|
||||
support-files =
|
||||
config_broken_json.json
|
||||
|
||||
[browser_policies_basic_tests.js]
|
||||
[browser_policies_broken_json.js]
|
||||
[browser_policies_enterprise_only.js]
|
||||
[browser_policies_mistyped_json.js]
|
|
@ -1,22 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
const {
|
||||
EnterprisePolicyTesting,
|
||||
PoliciesPrefTracker,
|
||||
} = ChromeUtils.import("resource://testing-common/EnterprisePolicyTesting.jsm", null);
|
||||
const {TestUtils} = ChromeUtils.import("resource://testing-common/TestUtils.jsm", null);
|
||||
|
||||
PoliciesPrefTracker.start();
|
||||
|
||||
async function setupPolicyEngineWithJson(json, customSchema) {
|
||||
PoliciesPrefTracker.restoreDefaultValues();
|
||||
if (typeof(json) != "object") {
|
||||
let filePath = getTestFilePath(json ? json : "non-existing-file.json");
|
||||
return EnterprisePolicyTesting.setupPolicyEngineWithJson(filePath, customSchema);
|
||||
}
|
||||
return EnterprisePolicyTesting.setupPolicyEngineWithJson(json, customSchema);
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
BROWSER_CHROME_MANIFESTS += [
|
||||
'browser/browser.ini',
|
||||
]
|
||||
|
||||
TESTING_JS_MODULES += [
|
||||
'EnterprisePolicyTesting.jsm',
|
||||
]
|
|
@ -113,8 +113,8 @@ if (AppConstants.platform == "android") {
|
|||
if (AppConstants.MOZ_GECKO_PROFILER) {
|
||||
initTable.profiler = ["@mozilla.org/tools/profiler;1", "nsIProfiler"];
|
||||
}
|
||||
if ("@mozilla.org/enterprisepolicies;1" in Cc) {
|
||||
initTable.policies = ["@mozilla.org/enterprisepolicies;1", "nsIEnterprisePolicies"];
|
||||
if ("@mozilla.org/browser/enterprisepolicies;1" in Cc) {
|
||||
initTable.policies = ["@mozilla.org/browser/enterprisepolicies;1", "nsIEnterprisePolicies"];
|
||||
}
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetters(Services, initTable);
|
||||
|
|
|
@ -59,7 +59,7 @@ function run_test() {
|
|||
if ("nsIAndroidBridge" in Ci) {
|
||||
checkService("androidBridge", Ci.nsIAndroidBridge);
|
||||
}
|
||||
if ("@mozilla.org/enterprisepolicies;1" in Cc) {
|
||||
if ("@mozilla.org/browser/enterprisepolicies;1" in Cc) {
|
||||
checkService("policies", Ci.nsIEnterprisePolicies);
|
||||
}
|
||||
|
||||
|
|
|
@ -986,7 +986,7 @@ nsXREDirProvider::DoStartup() {
|
|||
// In the content process it's loaded on demand when needed
|
||||
if (XRE_IsParentProcess()) {
|
||||
nsCOMPtr<nsIObserver> policies(
|
||||
do_GetService("@mozilla.org/enterprisepolicies;1"));
|
||||
do_GetService("@mozilla.org/browser/enterprisepolicies;1"));
|
||||
if (policies) {
|
||||
policies->Observe(nullptr, "policies-startup", nullptr);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче