Bug 1436113 - Part 1: Move browser/extensions/shield-recipe-client to toolkit/components/normandy r=Gijs
MozReview-Commit-ID: LidgzhI4Z7h --HG-- rename : browser/extensions/shield-recipe-client/content/AboutPages.jsm => toolkit/components/normandy/content/AboutPages.jsm rename : browser/extensions/shield-recipe-client/content/about-studies/about-studies.css => toolkit/components/normandy/content/about-studies/about-studies.css rename : browser/extensions/shield-recipe-client/content/about-studies/about-studies.html => toolkit/components/normandy/content/about-studies/about-studies.html rename : browser/extensions/shield-recipe-client/content/about-studies/about-studies.js => toolkit/components/normandy/content/about-studies/about-studies.js rename : browser/extensions/shield-recipe-client/content/about-studies/common.js => toolkit/components/normandy/content/about-studies/common.js rename : browser/extensions/shield-recipe-client/content/about-studies/img/shield-logo.png => toolkit/components/normandy/content/about-studies/img/shield-logo.png rename : browser/extensions/shield-recipe-client/content/about-studies/shield-studies.js => toolkit/components/normandy/content/about-studies/shield-studies.js rename : browser/extensions/shield-recipe-client/content/shield-content-frame.js => toolkit/components/normandy/content/shield-content-frame.js rename : browser/extensions/shield-recipe-client/content/shield-content-process.js => toolkit/components/normandy/content/shield-content-process.js rename : browser/extensions/shield-recipe-client/docs/data-collection.rst => toolkit/components/normandy/docs/data-collection.rst rename : browser/extensions/shield-recipe-client/docs/index.rst => toolkit/components/normandy/docs/index.rst rename : browser/extensions/shield-recipe-client/jar.mn => toolkit/components/normandy/jar.mn rename : browser/extensions/shield-recipe-client/lib/ActionSandboxManager.jsm => toolkit/components/normandy/lib/ActionSandboxManager.jsm rename : browser/extensions/shield-recipe-client/lib/AddonStudies.jsm => toolkit/components/normandy/lib/AddonStudies.jsm rename : browser/extensions/shield-recipe-client/lib/Addons.jsm => toolkit/components/normandy/lib/Addons.jsm rename : browser/extensions/shield-recipe-client/lib/CleanupManager.jsm => toolkit/components/normandy/lib/CleanupManager.jsm rename : browser/extensions/shield-recipe-client/lib/ClientEnvironment.jsm => toolkit/components/normandy/lib/ClientEnvironment.jsm rename : browser/extensions/shield-recipe-client/lib/EventEmitter.jsm => toolkit/components/normandy/lib/EventEmitter.jsm rename : browser/extensions/shield-recipe-client/lib/FilterExpressions.jsm => toolkit/components/normandy/lib/FilterExpressions.jsm rename : browser/extensions/shield-recipe-client/lib/Heartbeat.jsm => toolkit/components/normandy/lib/Heartbeat.jsm rename : browser/extensions/shield-recipe-client/lib/LogManager.jsm => toolkit/components/normandy/lib/LogManager.jsm rename : browser/extensions/shield-recipe-client/lib/NormandyApi.jsm => toolkit/components/normandy/lib/NormandyApi.jsm rename : browser/extensions/shield-recipe-client/lib/NormandyDriver.jsm => toolkit/components/normandy/lib/NormandyDriver.jsm rename : browser/extensions/shield-recipe-client/lib/PreferenceExperiments.jsm => toolkit/components/normandy/lib/PreferenceExperiments.jsm rename : browser/extensions/shield-recipe-client/lib/PreferenceFilters.jsm => toolkit/components/normandy/lib/PreferenceFilters.jsm rename : browser/extensions/shield-recipe-client/lib/RecipeRunner.jsm => toolkit/components/normandy/lib/RecipeRunner.jsm rename : browser/extensions/shield-recipe-client/lib/Sampling.jsm => toolkit/components/normandy/lib/Sampling.jsm rename : browser/extensions/shield-recipe-client/lib/SandboxManager.jsm => toolkit/components/normandy/lib/SandboxManager.jsm rename : browser/extensions/shield-recipe-client/lib/ShieldPreferences.jsm => toolkit/components/normandy/lib/ShieldPreferences.jsm rename : browser/extensions/shield-recipe-client/lib/Storage.jsm => toolkit/components/normandy/lib/Storage.jsm rename : browser/extensions/shield-recipe-client/lib/TelemetryEvents.jsm => toolkit/components/normandy/lib/TelemetryEvents.jsm rename : browser/extensions/shield-recipe-client/lib/Uptake.jsm => toolkit/components/normandy/lib/Uptake.jsm rename : browser/extensions/shield-recipe-client/lib/Utils.jsm => toolkit/components/normandy/lib/Utils.jsm rename : browser/extensions/shield-recipe-client/moz.build => toolkit/components/normandy/moz.build rename : browser/extensions/shield-recipe-client/skin/osx/Heartbeat.css => toolkit/components/normandy/skin/osx/Heartbeat.css rename : browser/extensions/shield-recipe-client/skin/shared/Heartbeat.css => toolkit/components/normandy/skin/shared/Heartbeat.css rename : browser/extensions/shield-recipe-client/skin/shared/heartbeat-icon.svg => toolkit/components/normandy/skin/shared/heartbeat-icon.svg rename : browser/extensions/shield-recipe-client/skin/shared/heartbeat-star-lit.svg => toolkit/components/normandy/skin/shared/heartbeat-star-lit.svg rename : browser/extensions/shield-recipe-client/skin/shared/heartbeat-star-off.svg => toolkit/components/normandy/skin/shared/heartbeat-star-off.svg rename : browser/extensions/shield-recipe-client/test/.eslintrc.js => toolkit/components/normandy/test/.eslintrc.js rename : browser/extensions/shield-recipe-client/test/browser/.eslintrc.js => toolkit/components/normandy/test/browser/.eslintrc.js rename : browser/extensions/shield-recipe-client/test/browser/action_server.sjs => toolkit/components/normandy/test/browser/action_server.sjs rename : browser/extensions/shield-recipe-client/test/browser/browser.ini => toolkit/components/normandy/test/browser/browser.ini rename : browser/extensions/shield-recipe-client/test/browser/browser_ActionSandboxManager.js => toolkit/components/normandy/test/browser/browser_ActionSandboxManager.js rename : browser/extensions/shield-recipe-client/test/browser/browser_AddonStudies.js => toolkit/components/normandy/test/browser/browser_AddonStudies.js rename : browser/extensions/shield-recipe-client/test/browser/browser_Addons.js => toolkit/components/normandy/test/browser/browser_Addons.js rename : browser/extensions/shield-recipe-client/test/browser/browser_CleanupManager.js => toolkit/components/normandy/test/browser/browser_CleanupManager.js rename : browser/extensions/shield-recipe-client/test/browser/browser_ClientEnvironment.js => toolkit/components/normandy/test/browser/browser_ClientEnvironment.js rename : browser/extensions/shield-recipe-client/test/browser/browser_EventEmitter.js => toolkit/components/normandy/test/browser/browser_EventEmitter.js rename : browser/extensions/shield-recipe-client/test/browser/browser_FilterExpressions.js => toolkit/components/normandy/test/browser/browser_FilterExpressions.js rename : browser/extensions/shield-recipe-client/test/browser/browser_Heartbeat.js => toolkit/components/normandy/test/browser/browser_Heartbeat.js rename : browser/extensions/shield-recipe-client/test/browser/browser_LogManager.js => toolkit/components/normandy/test/browser/browser_LogManager.js rename : browser/extensions/shield-recipe-client/test/browser/browser_bootstrap.js => toolkit/components/normandy/test/browser/browser_Normandy.js rename : browser/extensions/shield-recipe-client/test/browser/browser_NormandyDriver.js => toolkit/components/normandy/test/browser/browser_NormandyDriver.js rename : browser/extensions/shield-recipe-client/test/browser/browser_PreferenceExperiments.js => toolkit/components/normandy/test/browser/browser_PreferenceExperiments.js rename : browser/extensions/shield-recipe-client/test/browser/browser_RecipeRunner.js => toolkit/components/normandy/test/browser/browser_RecipeRunner.js rename : browser/extensions/shield-recipe-client/test/browser/browser_ShieldPreferences.js => toolkit/components/normandy/test/browser/browser_ShieldPreferences.js rename : browser/extensions/shield-recipe-client/test/browser/browser_ShieldRecipeClient.js => toolkit/components/normandy/test/browser/browser_ShieldRecipeClient.js rename : browser/extensions/shield-recipe-client/test/browser/browser_Storage.js => toolkit/components/normandy/test/browser/browser_Storage.js rename : browser/extensions/shield-recipe-client/test/browser/browser_about_preferences.js => toolkit/components/normandy/test/browser/browser_about_preferences.js rename : browser/extensions/shield-recipe-client/test/browser/browser_about_studies.js => toolkit/components/normandy/test/browser/browser_about_studies.js rename : browser/extensions/shield-recipe-client/test/browser/fixtures/addon-fixture/manifest.json => toolkit/components/normandy/test/browser/fixtures/addon-fixture/manifest.json rename : browser/extensions/shield-recipe-client/test/browser/fixtures/normandy.xpi => toolkit/components/normandy/test/browser/fixtures/normandy.xpi rename : browser/extensions/shield-recipe-client/test/browser/head.js => toolkit/components/normandy/test/browser/head.js rename : browser/extensions/shield-recipe-client/test/unit/.eslintrc.js => toolkit/components/normandy/test/unit/.eslintrc.js rename : browser/extensions/shield-recipe-client/test/unit/echo_server.sjs => toolkit/components/normandy/test/unit/echo_server.sjs rename : browser/extensions/shield-recipe-client/test/unit/head_xpc.js => toolkit/components/normandy/test/unit/head_xpc.js rename : browser/extensions/shield-recipe-client/test/unit/invalid_recipe_signature_api/api/v1/index.json => toolkit/components/normandy/test/unit/invalid_recipe_signature_api/api/v1/index.json rename : browser/extensions/shield-recipe-client/test/unit/invalid_recipe_signature_api/api/v1/recipe/signed/index.json => toolkit/components/normandy/test/unit/invalid_recipe_signature_api/api/v1/recipe/signed/index.json rename : browser/extensions/shield-recipe-client/test/unit/invalid_recipe_signature_api/normandy.content-signature.mozilla.org-20210705.dev.chain => toolkit/components/normandy/test/unit/invalid_recipe_signature_api/normandy.content-signature.mozilla.org-20210705.dev.chain rename : browser/extensions/shield-recipe-client/test/unit/mock_api/api/v1/action/console-log/implementation/sha384-RGx3rydrSq53UfmW9kFcK0mQYra67XIvZvr4MhmAe--ljiiMQOtgM7Cmca48um3v => toolkit/components/normandy/test/unit/mock_api/api/v1/action/console-log/implementation/sha384-RGx3rydrSq53UfmW9kFcK0mQYra67XIvZvr4MhmAe--ljiiMQOtgM7Cmca48um3v rename : browser/extensions/shield-recipe-client/test/unit/mock_api/api/v1/action/console-log/index.json => toolkit/components/normandy/test/unit/mock_api/api/v1/action/console-log/index.json rename : browser/extensions/shield-recipe-client/test/unit/mock_api/api/v1/action/index.json => toolkit/components/normandy/test/unit/mock_api/api/v1/action/index.json rename : browser/extensions/shield-recipe-client/test/unit/mock_api/api/v1/action/opt-out-study/implementation/sha384-HM_avYcD00o27ufwU1V7PIBtiuMAXML6MMwlYrDEqDX-XzGVuOfL52RCM680JExN => toolkit/components/normandy/test/unit/mock_api/api/v1/action/opt-out-study/implementation/sha384-HM_avYcD00o27ufwU1V7PIBtiuMAXML6MMwlYrDEqDX-XzGVuOfL52RCM680JExN rename : browser/extensions/shield-recipe-client/test/unit/mock_api/api/v1/action/opt-out-study/index.json => toolkit/components/normandy/test/unit/mock_api/api/v1/action/opt-out-study/index.json rename : browser/extensions/shield-recipe-client/test/unit/mock_api/api/v1/action/preference-experiment/implementation/sha384-KQgG38GQ7KZAb2VIB48ANQO6nBcxZoLm2ORzUviRT5nAvSywyPjZ5cJIElw6iXIt => toolkit/components/normandy/test/unit/mock_api/api/v1/action/preference-experiment/implementation/sha384-KQgG38GQ7KZAb2VIB48ANQO6nBcxZoLm2ORzUviRT5nAvSywyPjZ5cJIElw6iXIt rename : browser/extensions/shield-recipe-client/test/unit/mock_api/api/v1/action/preference-experiment/index.json => toolkit/components/normandy/test/unit/mock_api/api/v1/action/preference-experiment/index.json rename : browser/extensions/shield-recipe-client/test/unit/mock_api/api/v1/action/show-heartbeat/implementation/sha384-dEGiyKPEln8Ns5cQHzGpMIGdirSAAX0X-Kwlu-U3sJ05yNbO-ANij_a6c5SyL7G4 => toolkit/components/normandy/test/unit/mock_api/api/v1/action/show-heartbeat/implementation/sha384-dEGiyKPEln8Ns5cQHzGpMIGdirSAAX0X-Kwlu-U3sJ05yNbO-ANij_a6c5SyL7G4 rename : browser/extensions/shield-recipe-client/test/unit/mock_api/api/v1/action/show-heartbeat/index.json => toolkit/components/normandy/test/unit/mock_api/api/v1/action/show-heartbeat/index.json rename : browser/extensions/shield-recipe-client/test/unit/mock_api/api/v1/action/signed/index.json => toolkit/components/normandy/test/unit/mock_api/api/v1/action/signed/index.json rename : browser/extensions/shield-recipe-client/test/unit/mock_api/api/v1/classify_client/index.json => toolkit/components/normandy/test/unit/mock_api/api/v1/classify_client/index.json rename : browser/extensions/shield-recipe-client/test/unit/mock_api/api/v1/index.json => toolkit/components/normandy/test/unit/mock_api/api/v1/index.json rename : browser/extensions/shield-recipe-client/test/unit/mock_api/api/v1/recipe/index.json => toolkit/components/normandy/test/unit/mock_api/api/v1/recipe/index.json rename : browser/extensions/shield-recipe-client/test/unit/mock_api/api/v1/recipe/signed/index.json => toolkit/components/normandy/test/unit/mock_api/api/v1/recipe/signed/index.json rename : browser/extensions/shield-recipe-client/test/unit/mock_api/normandy.content-signature.mozilla.org-20210705.dev.chain => toolkit/components/normandy/test/unit/mock_api/normandy.content-signature.mozilla.org-20210705.dev.chain rename : browser/extensions/shield-recipe-client/test/unit/query_server.sjs => toolkit/components/normandy/test/unit/query_server.sjs rename : browser/extensions/shield-recipe-client/test/unit/test_NormandyApi.js => toolkit/components/normandy/test/unit/test_NormandyApi.js rename : browser/extensions/shield-recipe-client/test/unit/test_Sampling.js => toolkit/components/normandy/test/unit/test_Sampling.js rename : browser/extensions/shield-recipe-client/test/unit/test_SandboxManager.js => toolkit/components/normandy/test/unit/test_SandboxManager.js rename : browser/extensions/shield-recipe-client/test/unit/test_Utils.js => toolkit/components/normandy/test/unit/test_Utils.js rename : browser/extensions/shield-recipe-client/test/unit/utils.js => toolkit/components/normandy/test/unit/utils.js rename : browser/extensions/shield-recipe-client/test/unit/xpcshell.ini => toolkit/components/normandy/test/unit/xpcshell.ini rename : browser/extensions/shield-recipe-client/vendor/LICENSE_THIRDPARTY => toolkit/components/normandy/vendor/LICENSE_THIRDPARTY rename : browser/extensions/shield-recipe-client/vendor/PropTypes.js => toolkit/components/normandy/vendor/PropTypes.js rename : browser/extensions/shield-recipe-client/vendor/React.js => toolkit/components/normandy/vendor/React.js rename : browser/extensions/shield-recipe-client/vendor/ReactDOM.js => toolkit/components/normandy/vendor/ReactDOM.js rename : browser/extensions/shield-recipe-client/vendor/classnames.js => toolkit/components/normandy/vendor/classnames.js rename : browser/extensions/shield-recipe-client/vendor/mozjexl.js => toolkit/components/normandy/vendor/mozjexl.js extra : rebase_source : e498b709e515fb176840133d8232f145fd732bc3
|
@ -18,13 +18,11 @@ var gExceptionPaths = [
|
|||
"resource://app/defaults/preferences/",
|
||||
"resource://gre/modules/commonjs/",
|
||||
"resource://gre/defaults/pref/",
|
||||
"resource://shield-recipe-client/node_modules/jexl/lib/",
|
||||
|
||||
// These resources are referenced using relative paths from html files.
|
||||
"resource://payments/",
|
||||
|
||||
// https://github.com/mozilla/normandy/issues/577
|
||||
"resource://shield-recipe-client/test/",
|
||||
"resource://normandy-content/shield-content-frame.js",
|
||||
"resource://normandy-content/shield-content-process.js",
|
||||
|
||||
// https://github.com/mozilla/activity-stream/issues/3053
|
||||
"resource://activity-stream/data/content/tippytop/images/",
|
||||
|
@ -128,10 +126,6 @@ var whitelist = [
|
|||
// browser/extensions/pdfjs/content/web/viewer.js#7450
|
||||
{file: "resource://pdf.js/web/debugger.js"},
|
||||
|
||||
// These are used in content processes. They are actually referenced.
|
||||
{file: "resource://shield-recipe-client-content/shield-content-frame.js"},
|
||||
{file: "resource://shield-recipe-client-content/shield-content-process.js"},
|
||||
|
||||
// Starting from here, files in the whitelist are bugs that need fixing.
|
||||
// Bug 1339424 (wontfix?)
|
||||
{file: "chrome://browser/locale/taskbar.properties",
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"use strict";
|
||||
|
||||
add_task(async function test_policy_disable_shield() {
|
||||
const { RecipeRunner } = ChromeUtils.import("resource://shield-recipe-client/lib/RecipeRunner.jsm", {});
|
||||
const { RecipeRunner } = ChromeUtils.import("resource://normandy/lib/RecipeRunner.jsm", {});
|
||||
|
||||
await SpecialPowers.pushPrefEnv({ set: [["extensions.shield-recipe-client.api_url",
|
||||
"https://localhost/selfsupport-dummy/"],
|
||||
|
|
|
@ -111,6 +111,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {
|
|||
LoginManagerParent: "resource://gre/modules/LoginManagerParent.jsm",
|
||||
NetUtil: "resource://gre/modules/NetUtil.jsm",
|
||||
NewTabUtils: "resource://gre/modules/NewTabUtils.jsm",
|
||||
Normandy: "resource://normandy/Normandy.jsm",
|
||||
OS: "resource://gre/modules/osfile.jsm",
|
||||
PageActions: "resource:///modules/PageActions.jsm",
|
||||
PageThumbs: "resource://gre/modules/PageThumbs.jsm",
|
||||
|
@ -711,6 +712,7 @@ BrowserGlue.prototype = {
|
|||
author: vendorShortName,
|
||||
});
|
||||
|
||||
Normandy.init();
|
||||
|
||||
// Initialize the default l10n resource sources for L10nRegistry.
|
||||
let locales = Services.locale.getPackagedLocales();
|
||||
|
@ -1059,6 +1061,8 @@ BrowserGlue.prototype = {
|
|||
if (AppConstants.NIGHTLY_BUILD && AppConstants.MOZ_DATA_REPORTING) {
|
||||
this.browserErrorReporter.uninit();
|
||||
}
|
||||
|
||||
Normandy.uninit();
|
||||
},
|
||||
|
||||
// All initial windows have opened.
|
||||
|
|
|
@ -13,7 +13,6 @@ DIRS += [
|
|||
'pdfjs',
|
||||
'pocket',
|
||||
'screenshots',
|
||||
'shield-recipe-client',
|
||||
'webcompat',
|
||||
]
|
||||
|
||||
|
|
|
@ -1,23 +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/. -->
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>about:studies</title>
|
||||
<link rel="stylesheet" href="chrome://global/skin/global.css">
|
||||
<link rel="stylesheet" href="chrome://global/skin/in-content/common.css">
|
||||
<link rel="stylesheet" href="resource://shield-recipe-client-content/about-studies/about-studies.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script src="resource://shield-recipe-client-vendor/React.js"></script>
|
||||
<script src="resource://shield-recipe-client-vendor/ReactDOM.js"></script>
|
||||
<script src="resource://shield-recipe-client-vendor/PropTypes.js"></script>
|
||||
<script src="resource://shield-recipe-client-vendor/classnames.js"></script>
|
||||
<script src="resource://shield-recipe-client-content/about-studies/common.js"></script>
|
||||
<script src="resource://shield-recipe-client-content/about-studies/shield-studies.js"></script>
|
||||
<script src="resource://shield-recipe-client-content/about-studies/about-studies.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,24 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
#filter substitution
|
||||
|
||||
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
|
||||
<Description about="urn:mozilla:install-manifest">
|
||||
<em:id>shield-recipe-client@mozilla.org</em:id>
|
||||
<em:type>2</em:type>
|
||||
<em:bootstrap>true</em:bootstrap>
|
||||
<em:unpack>false</em:unpack>
|
||||
<em:version>83</em:version>
|
||||
<em:name>Shield Recipe Client</em:name>
|
||||
<em:description>Client to download and run recipes for SHIELD, Heartbeat, etc.</em:description>
|
||||
<em:multiprocessCompatible>true</em:multiprocessCompatible>
|
||||
|
||||
<em:targetApplication>
|
||||
<Description>
|
||||
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
|
||||
<em:minVersion>@MOZ_APP_VERSION@</em:minVersion>
|
||||
<em:maxVersion>@MOZ_APP_MAXVERSION@</em:maxVersion>
|
||||
</Description>
|
||||
</em:targetApplication>
|
||||
</Description>
|
||||
</RDF>
|
|
@ -1,13 +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/.
|
||||
|
||||
[features/shield-recipe-client@mozilla.org] chrome.jar:
|
||||
% resource shield-recipe-client %
|
||||
lib/ (./lib/*)
|
||||
data/ (./data/*)
|
||||
skin/ (skin/*)
|
||||
% resource shield-recipe-client-content %content/ contentaccessible=yes
|
||||
content/ (./content/*)
|
||||
% resource shield-recipe-client-vendor %vendor/ contentaccessible=yes
|
||||
vendor/ (./vendor/*)
|
|
@ -1,86 +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";
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Log.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "LogManager",
|
||||
"resource://shield-recipe-client/lib/LogManager.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "RecipeRunner",
|
||||
"resource://shield-recipe-client/lib/RecipeRunner.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "CleanupManager",
|
||||
"resource://shield-recipe-client/lib/CleanupManager.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "PreferenceExperiments",
|
||||
"resource://shield-recipe-client/lib/PreferenceExperiments.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "AboutPages",
|
||||
"resource://shield-recipe-client-content/AboutPages.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "ShieldPreferences",
|
||||
"resource://shield-recipe-client/lib/ShieldPreferences.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "AddonStudies",
|
||||
"resource://shield-recipe-client/lib/AddonStudies.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "TelemetryEvents",
|
||||
"resource://shield-recipe-client/lib/TelemetryEvents.jsm");
|
||||
|
||||
var EXPORTED_SYMBOLS = ["ShieldRecipeClient"];
|
||||
|
||||
const PREF_LOGGING_LEVEL = "extensions.shield-recipe-client.logging.level";
|
||||
const SHIELD_INIT_NOTIFICATION = "shield-init-complete";
|
||||
|
||||
let log = null;
|
||||
|
||||
/**
|
||||
* Handles startup and shutdown of the entire add-on. Bootsrap.js defers to this
|
||||
* module for most tasks so that we can more easily test startup and shutdown
|
||||
* (bootstrap.js is difficult to import in tests).
|
||||
*/
|
||||
var ShieldRecipeClient = {
|
||||
async startup() {
|
||||
// Setup logging and listen for changes to logging prefs
|
||||
LogManager.configure(Services.prefs.getIntPref(PREF_LOGGING_LEVEL));
|
||||
Services.prefs.addObserver(PREF_LOGGING_LEVEL, LogManager.configure);
|
||||
CleanupManager.addCleanupHandler(
|
||||
() => Services.prefs.removeObserver(PREF_LOGGING_LEVEL, LogManager.configure),
|
||||
);
|
||||
log = LogManager.getLogger("bootstrap");
|
||||
|
||||
try {
|
||||
TelemetryEvents.init();
|
||||
} catch (err) {
|
||||
log.error("Failed to initialize telemetry events:", err);
|
||||
}
|
||||
|
||||
try {
|
||||
await AboutPages.init();
|
||||
} catch (err) {
|
||||
log.error("Failed to initialize about pages:", err);
|
||||
}
|
||||
|
||||
try {
|
||||
await AddonStudies.init();
|
||||
} catch (err) {
|
||||
log.error("Failed to initialize addon studies:", err);
|
||||
}
|
||||
|
||||
try {
|
||||
await PreferenceExperiments.init();
|
||||
} catch (err) {
|
||||
log.error("Failed to initialize preference experiments:", err);
|
||||
}
|
||||
|
||||
try {
|
||||
ShieldPreferences.init();
|
||||
} catch (err) {
|
||||
log.error("Failed to initialize preferences UI:", err);
|
||||
}
|
||||
|
||||
await RecipeRunner.init();
|
||||
Services.obs.notifyObservers(null, SHIELD_INIT_NOTIFICATION);
|
||||
},
|
||||
|
||||
async shutdown(reason) {
|
||||
await CleanupManager.cleanup();
|
||||
},
|
||||
};
|
|
@ -1,26 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
// Load our bootstrap extension manifest so we can access our chrome/resource URIs.
|
||||
// Cargo culted from formautofill system add-on
|
||||
const EXTENSION_ID = "shield-recipe-client@mozilla.org";
|
||||
let extensionDir = Services.dirsvc.get("GreD", Ci.nsIFile);
|
||||
extensionDir.append("browser");
|
||||
extensionDir.append("features");
|
||||
extensionDir.append(EXTENSION_ID);
|
||||
// If the unpacked extension doesn't exist, use the packed version.
|
||||
if (!extensionDir.exists()) {
|
||||
extensionDir = extensionDir.parent;
|
||||
extensionDir.append(EXTENSION_ID + ".xpi");
|
||||
}
|
||||
Components.manager.addBootstrappedManifestLocation(extensionDir);
|
||||
|
||||
// ================================================
|
||||
// Load mocking/stubbing library, sinon
|
||||
// docs: http://sinonjs.org/releases/v2.3.2/
|
||||
/* exported sinon */
|
||||
ChromeUtils.import("resource://gre/modules/Timer.jsm");
|
||||
Services.scriptloader.loadSubScript("resource://testing-common/sinon-2.3.2.js", this);
|
||||
/* globals sinon */
|
||||
// ================================================
|
|
@ -113,3 +113,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
|
|||
|
||||
if CONFIG['NIGHTLY_BUILD'] and CONFIG['MOZ_BUILD_APP'] == 'browser':
|
||||
DIRS += ['payments']
|
||||
|
||||
if CONFIG['MOZ_BUILD_APP'] == 'browser':
|
||||
DIRS += ['normandy']
|
||||
|
|
|
@ -9,17 +9,14 @@ ChromeUtils.import("resource://gre/modules/Services.jsm");
|
|||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "LogManager",
|
||||
"resource://shield-recipe-client/lib/LogManager.jsm");
|
||||
"resource://normandy/lib/LogManager.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "ShieldRecipeClient",
|
||||
"resource://shield-recipe-client/lib/ShieldRecipeClient.jsm");
|
||||
"resource://normandy/lib/ShieldRecipeClient.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "PreferenceExperiments",
|
||||
"resource://shield-recipe-client/lib/PreferenceExperiments.jsm");
|
||||
"resource://normandy/lib/PreferenceExperiments.jsm");
|
||||
|
||||
// Act as both a normal bootstrap.js and a JS module so that we can test
|
||||
// startup methods without having to install/uninstall the add-on.
|
||||
var EXPORTED_SYMBOLS = ["Bootstrap"];
|
||||
var EXPORTED_SYMBOLS = ["Normandy"];
|
||||
|
||||
const REASON_APP_STARTUP = 1;
|
||||
const UI_AVAILABLE_NOTIFICATION = "sessionstore-windows-restored";
|
||||
const STARTUP_EXPERIMENT_PREFS_BRANCH = "extensions.shield-recipe-client.startupExperimentPrefs.";
|
||||
const PREF_LOGGING_LEVEL = "extensions.shield-recipe-client.logging.level";
|
||||
|
@ -46,7 +43,40 @@ log.level = Services.prefs.getIntPref(PREF_LOGGING_LEVEL, Log.Level.Warn);
|
|||
|
||||
let studyPrefsChanged = {};
|
||||
|
||||
var Bootstrap = {
|
||||
var Normandy = {
|
||||
init() {
|
||||
// Initialization that needs to happen before the first paint on startup.
|
||||
this.initShieldPrefs(DEFAULT_PREFS);
|
||||
this.initExperimentPrefs();
|
||||
|
||||
// Wait until the UI is available before finishing initialization.
|
||||
Services.obs.addObserver(this, UI_AVAILABLE_NOTIFICATION);
|
||||
},
|
||||
|
||||
observe(subject, topic, data) {
|
||||
if (topic === UI_AVAILABLE_NOTIFICATION) {
|
||||
Services.obs.removeObserver(this, UI_AVAILABLE_NOTIFICATION);
|
||||
this.finishInit();
|
||||
}
|
||||
},
|
||||
|
||||
async finishInit() {
|
||||
await PreferenceExperiments.recordOriginalValues(studyPrefsChanged);
|
||||
ShieldRecipeClient.startup();
|
||||
},
|
||||
|
||||
async uninit() {
|
||||
// Wait for async write operations during shutdown before unloading modules.
|
||||
await ShieldRecipeClient.shutdown();
|
||||
|
||||
// In case the observer didn't run, clean it up.
|
||||
try {
|
||||
Services.obs.removeObserver(this, UI_AVAILABLE_NOTIFICATION);
|
||||
} catch (err) {
|
||||
// It must already be removed!
|
||||
}
|
||||
},
|
||||
|
||||
initShieldPrefs(defaultPrefs) {
|
||||
const prefBranch = Services.prefs.getDefaultBranch("");
|
||||
for (const [name, value] of Object.entries(defaultPrefs)) {
|
||||
|
@ -138,90 +168,4 @@ var Bootstrap = {
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
observe(subject, topic, data) {
|
||||
if (topic === UI_AVAILABLE_NOTIFICATION) {
|
||||
Services.obs.removeObserver(this, UI_AVAILABLE_NOTIFICATION);
|
||||
this.finishStartup();
|
||||
}
|
||||
},
|
||||
|
||||
install() {
|
||||
// Nothing to do during install
|
||||
},
|
||||
|
||||
startup(data, reason) {
|
||||
// Initialization that needs to happen before the first paint on startup.
|
||||
this.initShieldPrefs(DEFAULT_PREFS);
|
||||
this.initExperimentPrefs();
|
||||
|
||||
// If the app is starting up, wait until the UI is available before finishing
|
||||
// init.
|
||||
if (reason === REASON_APP_STARTUP) {
|
||||
Services.obs.addObserver(this, UI_AVAILABLE_NOTIFICATION);
|
||||
} else {
|
||||
this.finishStartup();
|
||||
}
|
||||
},
|
||||
|
||||
async finishStartup() {
|
||||
await PreferenceExperiments.recordOriginalValues(studyPrefsChanged);
|
||||
ShieldRecipeClient.startup();
|
||||
},
|
||||
|
||||
async shutdown(data, reason) {
|
||||
// Wait for async write operations during shutdown before unloading modules.
|
||||
await ShieldRecipeClient.shutdown(reason);
|
||||
|
||||
// In case the observer didn't run, clean it up.
|
||||
try {
|
||||
Services.obs.removeObserver(this, UI_AVAILABLE_NOTIFICATION);
|
||||
} catch (err) {
|
||||
// It must already be removed!
|
||||
}
|
||||
|
||||
// Unload add-on modules. We don't do this in ShieldRecipeClient so that
|
||||
// modules are not unloaded accidentally during tests.
|
||||
let modules = [
|
||||
"lib/ActionSandboxManager.jsm",
|
||||
"lib/Addons.jsm",
|
||||
"lib/AddonStudies.jsm",
|
||||
"lib/CleanupManager.jsm",
|
||||
"lib/ClientEnvironment.jsm",
|
||||
"lib/FilterExpressions.jsm",
|
||||
"lib/EventEmitter.jsm",
|
||||
"lib/Heartbeat.jsm",
|
||||
"lib/LogManager.jsm",
|
||||
"lib/NormandyApi.jsm",
|
||||
"lib/NormandyDriver.jsm",
|
||||
"lib/PreferenceExperiments.jsm",
|
||||
"lib/RecipeRunner.jsm",
|
||||
"lib/Sampling.jsm",
|
||||
"lib/SandboxManager.jsm",
|
||||
"lib/ShieldPreferences.jsm",
|
||||
"lib/ShieldRecipeClient.jsm",
|
||||
"lib/Storage.jsm",
|
||||
"lib/TelemetryEvents.jsm",
|
||||
"lib/Uptake.jsm",
|
||||
"lib/Utils.jsm",
|
||||
].map(m => `resource://shield-recipe-client/${m}`);
|
||||
modules = modules.concat([
|
||||
"resource://shield-recipe-client-content/AboutPages.jsm",
|
||||
"resource://shield-recipe-client-vendor/mozjexl.js",
|
||||
]);
|
||||
|
||||
for (const module of modules) {
|
||||
log.debug(`Unloading ${module}`);
|
||||
Cu.unload(module);
|
||||
}
|
||||
},
|
||||
|
||||
uninstall() {
|
||||
// Do nothing
|
||||
},
|
||||
};
|
||||
|
||||
// Expose bootstrap methods on the global
|
||||
for (const methodName of ["install", "startup", "shutdown", "uninstall"]) {
|
||||
this[methodName] = Bootstrap[methodName].bind(Bootstrap);
|
||||
}
|
|
@ -8,13 +8,13 @@ ChromeUtils.import("resource://gre/modules/Services.jsm");
|
|||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this, "CleanupManager", "resource://shield-recipe-client/lib/CleanupManager.jsm",
|
||||
this, "CleanupManager", "resource://normandy/lib/CleanupManager.jsm",
|
||||
);
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this, "AddonStudies", "resource://shield-recipe-client/lib/AddonStudies.jsm",
|
||||
this, "AddonStudies", "resource://normandy/lib/AddonStudies.jsm",
|
||||
);
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this, "RecipeRunner", "resource://shield-recipe-client/lib/RecipeRunner.jsm",
|
||||
this, "RecipeRunner", "resource://normandy/lib/RecipeRunner.jsm",
|
||||
);
|
||||
|
||||
var EXPORTED_SYMBOLS = ["AboutPages"];
|
||||
|
@ -24,14 +24,14 @@ const SHIELD_LEARN_MORE_URL_PREF = "extensions.shield-recipe-client.shieldLearnM
|
|||
// Due to bug 1051238 frame scripts are cached forever, so we can't update them
|
||||
// as a restartless add-on. The Math.random() is the work around for this.
|
||||
const PROCESS_SCRIPT = (
|
||||
`resource://shield-recipe-client-content/shield-content-process.js?${Math.random()}`
|
||||
`resource://normandy-content/shield-content-process.js?${Math.random()}`
|
||||
);
|
||||
const FRAME_SCRIPT = (
|
||||
`resource://shield-recipe-client-content/shield-content-frame.js?${Math.random()}`
|
||||
`resource://normandy-content/shield-content-frame.js?${Math.random()}`
|
||||
);
|
||||
|
||||
/**
|
||||
* Class for managing an about: page that Shield provides. Adapted from
|
||||
* Class for managing an about: page that Normandy provides. Adapted from
|
||||
* browser/extensions/pocket/content/AboutPocket.jsm.
|
||||
*
|
||||
* @implements nsIFactory
|
||||
|
@ -126,7 +126,7 @@ var AboutPages = {
|
|||
*/
|
||||
XPCOMUtils.defineLazyGetter(this.AboutPages, "aboutStudies", () => {
|
||||
const aboutStudies = new AboutPage({
|
||||
chromeUrl: "resource://shield-recipe-client-content/about-studies/about-studies.html",
|
||||
chromeUrl: "resource://normandy-content/about-studies/about-studies.html",
|
||||
aboutHost: "studies",
|
||||
classId: "{6ab96943-a163-482c-9622-4faedc0e827f}",
|
||||
description: "Shield Study Listing",
|
||||
|
@ -146,6 +146,7 @@ XPCOMUtils.defineLazyGetter(this.AboutPages, "aboutStudies", () => {
|
|||
Services.mm.addMessageListener("Shield:GetStudyList", this);
|
||||
Services.mm.addMessageListener("Shield:RemoveStudy", this);
|
||||
Services.mm.addMessageListener("Shield:OpenDataPreferences", this);
|
||||
Services.mm.addMessageListener("Shield:GetStudiesEnabled", this);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -155,6 +156,7 @@ XPCOMUtils.defineLazyGetter(this.AboutPages, "aboutStudies", () => {
|
|||
Services.mm.removeMessageListener("Shield:GetStudyList", this);
|
||||
Services.mm.removeMessageListener("Shield:RemoveStudy", this);
|
||||
Services.mm.removeMessageListener("Shield:OpenDataPreferences", this);
|
||||
Services.mm.removeMessageListener("Shield:GetStudiesEnabled", this);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -173,6 +175,9 @@ XPCOMUtils.defineLazyGetter(this.AboutPages, "aboutStudies", () => {
|
|||
case "Shield:OpenDataPreferences":
|
||||
this.openDataPreferences();
|
||||
break;
|
||||
case "Shield:GetStudiesEnabled":
|
||||
this.sendStudiesEnabled(message.target);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -194,6 +199,28 @@ XPCOMUtils.defineLazyGetter(this.AboutPages, "aboutStudies", () => {
|
|||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Get if studies are enabled and send it to the process that
|
||||
* requested them. This has to be in the parent process, since
|
||||
* RecipeRunner is stateful, and can't be interacted with from
|
||||
* content processes safely.
|
||||
*
|
||||
* @param {<browser>} target
|
||||
* XUL <browser> element for the tab containing the about:studies page
|
||||
* that requested a study list.
|
||||
*/
|
||||
sendStudiesEnabled(target) {
|
||||
RecipeRunner.checkPrefs();
|
||||
try {
|
||||
target.messageManager.sendAsyncMessage("Shield:ReceiveStudiesEnabled", {
|
||||
studiesEnabled: RecipeRunner.enabled,
|
||||
});
|
||||
} catch (err) {
|
||||
// The child process might be gone, so no need to throw here.
|
||||
Cu.reportError(err);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Disable an active study and remove its add-on.
|
||||
* @param {String} studyName
|
|
@ -0,0 +1,23 @@
|
|||
<!-- 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/. -->
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>about:studies</title>
|
||||
<link rel="stylesheet" href="chrome://global/skin/global.css">
|
||||
<link rel="stylesheet" href="chrome://global/skin/in-content/common.css">
|
||||
<link rel="stylesheet" href="resource://normandy-content/about-studies/about-studies.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script src="resource://normandy-vendor/React.js"></script>
|
||||
<script src="resource://normandy-vendor/ReactDOM.js"></script>
|
||||
<script src="resource://normandy-vendor/PropTypes.js"></script>
|
||||
<script src="resource://normandy-vendor/classnames.js"></script>
|
||||
<script src="resource://normandy-content/about-studies/common.js"></script>
|
||||
<script src="resource://normandy-content/about-studies/shield-studies.js"></script>
|
||||
<script src="resource://normandy-content/about-studies/about-studies.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -15,7 +15,7 @@ const PAGES = new Map([
|
|||
["shieldStudies", {
|
||||
name: "Shield Studies",
|
||||
component: ShieldStudies,
|
||||
icon: "resource://shield-recipe-client-content/about-studies/img/shield-logo.png",
|
||||
icon: "resource://normandy-content/about-studies/img/shield-logo.png",
|
||||
}],
|
||||
]);
|
||||
|
|
@ -50,7 +50,7 @@ window.FxButton.propTypes = {
|
|||
* Wrapper class for a value that is provided by the frame script.
|
||||
*
|
||||
* Emits a "GetRemoteValue:{name}" page event on load to fetch the initial
|
||||
* value, and listens for "ReceiveRemoveValue:{name}" page callbacks to receive
|
||||
* value, and listens for "ReceiveRemoteValue:{name}" page callbacks to receive
|
||||
* the value when it updates.
|
||||
*
|
||||
* @example
|
До Ширина: | Высота: | Размер: 5.1 KiB После Ширина: | Высота: | Размер: 5.1 KiB |
|
@ -20,7 +20,7 @@ ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
|||
|
||||
const frameGlobal = {};
|
||||
ChromeUtils.defineModuleGetter(
|
||||
frameGlobal, "AboutPages", "resource://shield-recipe-client-content/AboutPages.jsm",
|
||||
frameGlobal, "AboutPages", "resource://normandy-content/AboutPages.jsm",
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -39,6 +39,7 @@ class ShieldFrameListener {
|
|||
// in order to save resources for tabs that don't ever load about:studies.
|
||||
addMessageListener("Shield:ShuttingDown", this);
|
||||
addMessageListener("Shield:ReceiveStudyList", this);
|
||||
addMessageListener("Shield:ReceiveStudiesEnabled", this);
|
||||
|
||||
switch (event.detail.action) {
|
||||
// Actions that require the parent process
|
||||
|
@ -48,6 +49,12 @@ class ShieldFrameListener {
|
|||
case "RemoveStudy":
|
||||
sendAsyncMessage("Shield:RemoveStudy", event.detail.data);
|
||||
break;
|
||||
case "GetRemoteValue:StudiesEnabled":
|
||||
sendAsyncMessage("Shield:GetStudiesEnabled");
|
||||
break;
|
||||
case "NavigateToDataPreferences":
|
||||
sendAsyncMessage("Shield:OpenDataPreferences");
|
||||
break;
|
||||
// Actions that can be performed in the content process
|
||||
case "GetRemoteValue:ShieldLearnMoreHref":
|
||||
this.triggerPageCallback(
|
||||
|
@ -55,15 +62,6 @@ class ShieldFrameListener {
|
|||
frameGlobal.AboutPages.aboutStudies.getShieldLearnMoreHref()
|
||||
);
|
||||
break;
|
||||
case "GetRemoteValue:StudiesEnabled":
|
||||
this.triggerPageCallback(
|
||||
"ReceiveRemoteValue:StudiesEnabled",
|
||||
frameGlobal.AboutPages.aboutStudies.getStudiesEnabled()
|
||||
);
|
||||
break;
|
||||
case "NavigateToDataPreferences":
|
||||
sendAsyncMessage("Shield:OpenDataPreferences");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -85,6 +83,9 @@ class ShieldFrameListener {
|
|||
case "Shield:ReceiveStudyList":
|
||||
this.triggerPageCallback("ReceiveRemoteValue:StudyList", message.data.studies);
|
||||
break;
|
||||
case "Shield:ReceiveStudiesEnabled":
|
||||
this.triggerPageCallback("ReceiveRemoteValue:StudiesEnabled", message.data.studiesEnabled);
|
||||
break;
|
||||
case "Shield:ShuttingDown":
|
||||
this.onShutdown();
|
||||
break;
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://shield-recipe-client-content/AboutPages.jsm");
|
||||
ChromeUtils.import("resource://normandy-content/AboutPages.jsm");
|
||||
|
||||
class ShieldChildListener {
|
||||
onStartup() {
|
||||
|
@ -27,7 +27,7 @@ class ShieldChildListener {
|
|||
|
||||
// Unload AboutPages.jsm in case the add-on is reinstalled and we need to
|
||||
// load a new version of it.
|
||||
Cu.unload("resource://shield-recipe-client-content/AboutPages.jsm");
|
||||
Cu.unload("resource://normandy-content/AboutPages.jsm");
|
||||
}
|
||||
|
||||
receiveMessage(message) {
|
|
@ -0,0 +1,15 @@
|
|||
# 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/.
|
||||
|
||||
toolkit.jar:
|
||||
% resource normandy %res/normandy/
|
||||
res/normandy/Normandy.jsm (./Normandy.jsm)
|
||||
res/normandy/lib/ (./lib/*)
|
||||
res/normandy/skin/ (./skin/*)
|
||||
|
||||
% resource normandy-content %res/normandy/content/ contentaccessible=yes
|
||||
res/normandy/content/ (./content/*)
|
||||
|
||||
% resource normandy-vendor %res/normandy/vendor/ contentaccessible=yes
|
||||
res/normandy/vendor/ (./vendor/*)
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/NormandyDriver.jsm");
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/SandboxManager.jsm");
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/LogManager.jsm");
|
||||
ChromeUtils.import("resource://normandy/lib/NormandyDriver.jsm");
|
||||
ChromeUtils.import("resource://normandy/lib/SandboxManager.jsm");
|
||||
ChromeUtils.import("resource://normandy/lib/LogManager.jsm");
|
||||
|
||||
var EXPORTED_SYMBOLS = ["ActionSandboxManager"];
|
||||
|
|
@ -33,12 +33,12 @@ ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
|||
ChromeUtils.defineModuleGetter(this, "FileUtils", "resource://gre/modules/FileUtils.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "IndexedDB", "resource://gre/modules/IndexedDB.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "AddonManager", "resource://gre/modules/AddonManager.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "Addons", "resource://shield-recipe-client/lib/Addons.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "Addons", "resource://normandy/lib/Addons.jsm");
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this, "CleanupManager", "resource://shield-recipe-client/lib/CleanupManager.jsm"
|
||||
this, "CleanupManager", "resource://normandy/lib/CleanupManager.jsm"
|
||||
);
|
||||
ChromeUtils.defineModuleGetter(this, "LogManager", "resource://shield-recipe-client/lib/LogManager.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "TelemetryEvents", "resource://shield-recipe-client/lib/TelemetryEvents.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "LogManager", "resource://normandy/lib/LogManager.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "TelemetryEvents", "resource://normandy/lib/TelemetryEvents.jsm");
|
||||
|
||||
Cu.importGlobalProperties(["fetch"]); /* globals fetch */
|
||||
|
|
@ -9,7 +9,7 @@ ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
|||
ChromeUtils.defineModuleGetter(this, "AddonManager", "resource://gre/modules/AddonManager.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "Extension", "resource://gre/modules/Extension.jsm");
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this, "CleanupManager", "resource://shield-recipe-client/lib/CleanupManager.jsm"
|
||||
this, "CleanupManager", "resource://normandy/lib/CleanupManager.jsm"
|
||||
);
|
||||
|
||||
var EXPORTED_SYMBOLS = ["Addons"];
|
|
@ -12,14 +12,14 @@ ChromeUtils.defineModuleGetter(this, "ShellService", "resource:///modules/ShellS
|
|||
ChromeUtils.defineModuleGetter(this, "AddonManager", "resource://gre/modules/AddonManager.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "TelemetryArchive", "resource://gre/modules/TelemetryArchive.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "UpdateUtils", "resource://gre/modules/UpdateUtils.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "NormandyApi", "resource://shield-recipe-client/lib/NormandyApi.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "NormandyApi", "resource://normandy/lib/NormandyApi.jsm");
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this,
|
||||
"PreferenceExperiments",
|
||||
"resource://shield-recipe-client/lib/PreferenceExperiments.jsm"
|
||||
"resource://normandy/lib/PreferenceExperiments.jsm"
|
||||
);
|
||||
ChromeUtils.defineModuleGetter(this, "Utils", "resource://shield-recipe-client/lib/Utils.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "Addons", "resource://shield-recipe-client/lib/Addons.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "Utils", "resource://normandy/lib/Utils.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "Addons", "resource://normandy/lib/Addons.jsm");
|
||||
|
||||
const {generateUUID} = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator);
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/LogManager.jsm");
|
||||
ChromeUtils.import("resource://normandy/lib/LogManager.jsm");
|
||||
|
||||
var EXPORTED_SYMBOLS = ["EventEmitter"];
|
||||
|
|
@ -5,10 +5,10 @@
|
|||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/Sampling.jsm");
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/PreferenceFilters.jsm");
|
||||
ChromeUtils.import("resource://normandy/lib/Sampling.jsm");
|
||||
ChromeUtils.import("resource://normandy/lib/PreferenceFilters.jsm");
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "mozjexl", "resource://shield-recipe-client-vendor/mozjexl.js");
|
||||
ChromeUtils.defineModuleGetter(this, "mozjexl", "resource://normandy-vendor/mozjexl.js");
|
||||
|
||||
var EXPORTED_SYMBOLS = ["FilterExpressions"];
|
||||
|
|
@ -9,9 +9,9 @@ ChromeUtils.import("resource://gre/modules/Preferences.jsm");
|
|||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/TelemetryController.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Timer.jsm");
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/CleanupManager.jsm");
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/EventEmitter.jsm");
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/LogManager.jsm");
|
||||
ChromeUtils.import("resource://normandy/lib/CleanupManager.jsm");
|
||||
ChromeUtils.import("resource://normandy/lib/EventEmitter.jsm");
|
||||
ChromeUtils.import("resource://normandy/lib/LogManager.jsm");
|
||||
|
||||
Cu.importGlobalProperties(["URL"]); /* globals URL */
|
||||
|
||||
|
@ -19,8 +19,8 @@ var EXPORTED_SYMBOLS = ["Heartbeat"];
|
|||
|
||||
const PREF_SURVEY_DURATION = "browser.uitour.surveyDuration";
|
||||
const NOTIFICATION_TIME = 3000;
|
||||
const HEARTBEAT_CSS_URI = Services.io.newURI("resource://shield-recipe-client/skin/shared/Heartbeat.css");
|
||||
const HEARTBEAT_CSS_URI_OSX = Services.io.newURI("resource://shield-recipe-client/skin/osx/Heartbeat.css");
|
||||
const HEARTBEAT_CSS_URI = Services.io.newURI("resource://normandy/skin/shared/Heartbeat.css");
|
||||
const HEARTBEAT_CSS_URI_OSX = Services.io.newURI("resource://normandy/skin/osx/Heartbeat.css");
|
||||
|
||||
const log = LogManager.getLogger("heartbeat");
|
||||
const windowsWithInjectedCss = new WeakSet();
|
||||
|
@ -157,7 +157,7 @@ var Heartbeat = class {
|
|||
this.notice = this.notificationBox.appendNotification(
|
||||
this.options.message,
|
||||
"heartbeat-" + this.options.flowId,
|
||||
"resource://shield-recipe-client/skin/shared/heartbeat-icon.svg",
|
||||
"resource://normandy/skin/shared/heartbeat-icon.svg",
|
||||
this.notificationBox.PRIORITY_INFO_HIGH,
|
||||
this.buttons,
|
||||
eventType => {
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/LogManager.jsm");
|
||||
ChromeUtils.import("resource://normandy/lib/LogManager.jsm");
|
||||
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this, "CanonicalJSON", "resource://gre/modules/CanonicalJSON.jsm");
|
|
@ -10,18 +10,18 @@ ChromeUtils.import("resource://gre/modules/Preferences.jsm");
|
|||
ChromeUtils.import("resource:///modules/ShellService.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/AddonManager.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Timer.jsm");
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/Addons.jsm");
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/LogManager.jsm");
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/Storage.jsm");
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/Heartbeat.jsm");
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/FilterExpressions.jsm");
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/ClientEnvironment.jsm");
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/PreferenceExperiments.jsm");
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/Sampling.jsm");
|
||||
ChromeUtils.import("resource://normandy/lib/Addons.jsm");
|
||||
ChromeUtils.import("resource://normandy/lib/LogManager.jsm");
|
||||
ChromeUtils.import("resource://normandy/lib/Storage.jsm");
|
||||
ChromeUtils.import("resource://normandy/lib/Heartbeat.jsm");
|
||||
ChromeUtils.import("resource://normandy/lib/FilterExpressions.jsm");
|
||||
ChromeUtils.import("resource://normandy/lib/ClientEnvironment.jsm");
|
||||
ChromeUtils.import("resource://normandy/lib/PreferenceExperiments.jsm");
|
||||
ChromeUtils.import("resource://normandy/lib/Sampling.jsm");
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "UpdateUtils", "resource://gre/modules/UpdateUtils.jsm");
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this, "AddonStudies", "resource://shield-recipe-client/lib/AddonStudies.jsm");
|
||||
this, "AddonStudies", "resource://normandy/lib/AddonStudies.jsm");
|
||||
|
||||
const {generateUUID} = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator);
|
||||
|
|
@ -55,12 +55,12 @@
|
|||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "Services", "resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "CleanupManager", "resource://shield-recipe-client/lib/CleanupManager.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "CleanupManager", "resource://normandy/lib/CleanupManager.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "JSONFile", "resource://gre/modules/JSONFile.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "LogManager", "resource://shield-recipe-client/lib/LogManager.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "LogManager", "resource://normandy/lib/LogManager.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "TelemetryEnvironment", "resource://gre/modules/TelemetryEnvironment.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "TelemetryEvents", "resource://shield-recipe-client/lib/TelemetryEvents.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "TelemetryEvents", "resource://normandy/lib/TelemetryEvents.jsm");
|
||||
|
||||
var EXPORTED_SYMBOLS = ["PreferenceExperiments"];
|
||||
|
|
@ -6,32 +6,32 @@
|
|||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/LogManager.jsm");
|
||||
ChromeUtils.import("resource://normandy/lib/LogManager.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "timerManager",
|
||||
"@mozilla.org/updates/timer-manager;1",
|
||||
"nsIUpdateTimerManager");
|
||||
ChromeUtils.defineModuleGetter(this, "Preferences", "resource://gre/modules/Preferences.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "Storage",
|
||||
"resource://shield-recipe-client/lib/Storage.jsm");
|
||||
"resource://normandy/lib/Storage.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "NormandyDriver",
|
||||
"resource://shield-recipe-client/lib/NormandyDriver.jsm");
|
||||
"resource://normandy/lib/NormandyDriver.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "FilterExpressions",
|
||||
"resource://shield-recipe-client/lib/FilterExpressions.jsm");
|
||||
"resource://normandy/lib/FilterExpressions.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "NormandyApi",
|
||||
"resource://shield-recipe-client/lib/NormandyApi.jsm");
|
||||
"resource://normandy/lib/NormandyApi.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "SandboxManager",
|
||||
"resource://shield-recipe-client/lib/SandboxManager.jsm");
|
||||
"resource://normandy/lib/SandboxManager.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "ClientEnvironment",
|
||||
"resource://shield-recipe-client/lib/ClientEnvironment.jsm");
|
||||
"resource://normandy/lib/ClientEnvironment.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "CleanupManager",
|
||||
"resource://shield-recipe-client/lib/CleanupManager.jsm");
|
||||
"resource://normandy/lib/CleanupManager.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "ActionSandboxManager",
|
||||
"resource://shield-recipe-client/lib/ActionSandboxManager.jsm");
|
||||
"resource://normandy/lib/ActionSandboxManager.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "AddonStudies",
|
||||
"resource://shield-recipe-client/lib/AddonStudies.jsm");
|
||||
"resource://normandy/lib/AddonStudies.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "Uptake",
|
||||
"resource://shield-recipe-client/lib/Uptake.jsm");
|
||||
"resource://normandy/lib/Uptake.jsm");
|
||||
|
||||
Cu.importGlobalProperties(["fetch"]);
|
||||
|
|
@ -10,10 +10,10 @@ ChromeUtils.defineModuleGetter(
|
|||
this, "AppConstants", "resource://gre/modules/AppConstants.jsm"
|
||||
);
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this, "AddonStudies", "resource://shield-recipe-client/lib/AddonStudies.jsm"
|
||||
this, "AddonStudies", "resource://normandy/lib/AddonStudies.jsm"
|
||||
);
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this, "CleanupManager", "resource://shield-recipe-client/lib/CleanupManager.jsm"
|
||||
this, "CleanupManager", "resource://normandy/lib/CleanupManager.jsm"
|
||||
);
|
||||
|
||||
var EXPORTED_SYMBOLS = ["ShieldPreferences"];
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/LogManager.jsm");
|
||||
ChromeUtils.import("resource://normandy/lib/LogManager.jsm");
|
||||
|
||||
var EXPORTED_SYMBOLS = ["Utils"];
|
||||
|
|
@ -4,21 +4,12 @@
|
|||
# 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/.
|
||||
|
||||
DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
|
||||
DEFINES['MOZ_APP_MAXVERSION'] = CONFIG['MOZ_APP_MAXVERSION']
|
||||
|
||||
FINAL_TARGET_FILES.features['shield-recipe-client@mozilla.org'] += [
|
||||
'bootstrap.js',
|
||||
]
|
||||
|
||||
FINAL_TARGET_PP_FILES.features['shield-recipe-client@mozilla.org'] += [
|
||||
'install.rdf.in'
|
||||
]
|
||||
|
||||
BROWSER_CHROME_MANIFESTS += ['test/browser/browser.ini']
|
||||
|
||||
XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
|
||||
with Files('**'):
|
||||
BUG_COMPONENT = ('Firefox', 'Normandy Client')
|
||||
|
||||
JAR_MANIFESTS += ['jar.mn']
|
||||
|
||||
SPHINX_TREES['shield-recipe-client'] = 'docs'
|
||||
SPHINX_TREES['normandy'] = 'docs'
|
||||
|
||||
BROWSER_CHROME_MANIFESTS += ['test/browser/browser.ini']
|
||||
XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
|
|
@ -114,7 +114,7 @@ notification.heartbeat {
|
|||
}
|
||||
|
||||
.heartbeat > #star-rating-container > .star-x {
|
||||
background: url("resource://shield-recipe-client/skin/shared/heartbeat-star-off.svg");
|
||||
background: url("resource://normandy/skin/shared/heartbeat-star-off.svg");
|
||||
cursor: pointer;
|
||||
height: 16px;
|
||||
margin-inline-end: 4px !important; /* Overrides the margin-inline-end for all platforms defined in the .plain class */
|
||||
|
@ -123,5 +123,5 @@ notification.heartbeat {
|
|||
|
||||
.heartbeat > #star-rating-container > .star-x:hover,
|
||||
.heartbeat > #star-rating-container > .star-x:hover ~ .star-x {
|
||||
background: url("resource://shield-recipe-client/skin/shared/heartbeat-star-lit.svg");
|
||||
background: url("resource://normandy/skin/shared/heartbeat-star-lit.svg");
|
||||
}
|
До Ширина: | Высота: | Размер: 3.5 KiB После Ширина: | Высота: | Размер: 3.5 KiB |
До Ширина: | Высота: | Размер: 641 B После Ширина: | Высота: | Размер: 641 B |
До Ширина: | Высота: | Размер: 641 B После Ширина: | Высота: | Размер: 641 B |
|
@ -3,23 +3,23 @@ support-files =
|
|||
action_server.sjs
|
||||
fixtures/normandy.xpi
|
||||
head = head.js
|
||||
[browser_ActionSandboxManager.js]
|
||||
[browser_Addons.js]
|
||||
[browser_AddonStudies.js]
|
||||
[browser_bootstrap.js]
|
||||
[browser_CleanupManager.js]
|
||||
[browser_NormandyDriver.js]
|
||||
[browser_FilterExpressions.js]
|
||||
[browser_EventEmitter.js]
|
||||
[browser_Storage.js]
|
||||
[browser_Heartbeat.js]
|
||||
[browser_RecipeRunner.js]
|
||||
[browser_LogManager.js]
|
||||
[browser_ClientEnvironment.js]
|
||||
[browser_ShieldRecipeClient.js]
|
||||
[browser_ShieldPreferences.js]
|
||||
[browser_PreferenceExperiments.js]
|
||||
[browser_about_studies.js]
|
||||
[browser_about_preferences.js]
|
||||
# Skip this test when FHR/Telemetry aren't available.
|
||||
skip-if = !healthreport || !telemetry
|
||||
[browser_about_studies.js]
|
||||
[browser_ActionSandboxManager.js]
|
||||
[browser_Addons.js]
|
||||
[browser_AddonStudies.js]
|
||||
[browser_CleanupManager.js]
|
||||
[browser_ClientEnvironment.js]
|
||||
[browser_EventEmitter.js]
|
||||
[browser_FilterExpressions.js]
|
||||
[browser_Heartbeat.js]
|
||||
[browser_LogManager.js]
|
||||
[browser_Normandy.js]
|
||||
[browser_NormandyDriver.js]
|
||||
[browser_PreferenceExperiments.js]
|
||||
[browser_RecipeRunner.js]
|
||||
[browser_ShieldPreferences.js]
|
||||
[browser_ShieldRecipeClient.js]
|
||||
[browser_Storage.js]
|
|
@ -1,7 +1,7 @@
|
|||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/ActionSandboxManager.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/NormandyDriver.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/ActionSandboxManager.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/NormandyDriver.jsm", this);
|
||||
|
||||
async function withManager(script, testFunction) {
|
||||
const manager = new ActionSandboxManager(script);
|
|
@ -3,9 +3,9 @@
|
|||
ChromeUtils.import("resource://gre/modules/IndexedDB.jsm", this);
|
||||
ChromeUtils.import("resource://testing-common/TestUtils.jsm", this);
|
||||
ChromeUtils.import("resource://testing-common/AddonTestUtils.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/Addons.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/AddonStudies.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/TelemetryEvents.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/Addons.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/AddonStudies.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/TelemetryEvents.jsm", this);
|
||||
|
||||
// Initialize test utils
|
||||
AddonTestUtils.initMochitest(this);
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
ChromeUtils.import("resource://testing-common/AddonTestUtils.jsm", this);
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/Addons.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/Addons.jsm", this);
|
||||
|
||||
// Initialize test utils
|
||||
AddonTestUtils.initMochitest(this);
|
|
@ -1,6 +1,6 @@
|
|||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/CleanupManager.jsm", this); /* global CleanupManagerClass */
|
||||
ChromeUtils.import("resource://normandy/lib/CleanupManager.jsm", this); /* global CleanupManagerClass */
|
||||
|
||||
add_task(async function testCleanupManager() {
|
||||
const spy1 = sinon.spy();
|
|
@ -4,8 +4,8 @@ ChromeUtils.import("resource://gre/modules/Services.jsm", this);
|
|||
ChromeUtils.import("resource://gre/modules/TelemetryController.jsm", this);
|
||||
ChromeUtils.import("resource://gre/modules/AddonManager.jsm", this);
|
||||
ChromeUtils.import("resource://testing-common/AddonTestUtils.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/ClientEnvironment.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/PreferenceExperiments.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/ClientEnvironment.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/PreferenceExperiments.jsm", this);
|
||||
|
||||
|
||||
add_task(async function testTelemetry() {
|
|
@ -1,7 +1,7 @@
|
|||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/EventEmitter.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/EventEmitter.jsm", this);
|
||||
|
||||
const evidence = {
|
||||
a: 0,
|
|
@ -1,6 +1,6 @@
|
|||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/FilterExpressions.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/FilterExpressions.jsm", this);
|
||||
|
||||
// Basic JEXL tests
|
||||
add_task(async function() {
|
|
@ -1,8 +1,8 @@
|
|||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/Heartbeat.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/SandboxManager.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/Heartbeat.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/SandboxManager.jsm", this);
|
||||
|
||||
/**
|
||||
* Assert an array is in non-descending order, and that every element is a number
|
|
@ -1,7 +1,7 @@
|
|||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Log.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/LogManager.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/LogManager.jsm", this);
|
||||
|
||||
add_task(async function() {
|
||||
// Ensure that configuring the logger affects all generated loggers.
|
|
@ -1,25 +1,8 @@
|
|||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/ShieldRecipeClient.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/PreferenceExperiments.jsm", this);
|
||||
|
||||
// We can't import bootstrap.js directly since it isn't in the jar manifest, but
|
||||
// we can use Addon.getResourceURI to get a path to the file and import using
|
||||
// that instead.
|
||||
ChromeUtils.import("resource://gre/modules/AddonManager.jsm", this);
|
||||
const bootstrapPromise = AddonManager.getAddonByID("shield-recipe-client@mozilla.org").then(addon => {
|
||||
const bootstrapUri = addon.getResourceURI("bootstrap.js");
|
||||
const {Bootstrap} = ChromeUtils.import(bootstrapUri.spec, {});
|
||||
return Bootstrap;
|
||||
});
|
||||
|
||||
// Use a decorator to get around getAddonByID being async.
|
||||
function withBootstrap(testFunction) {
|
||||
return async function wrappedTestFunction(...args) {
|
||||
const Bootstrap = await bootstrapPromise;
|
||||
return testFunction(...args, Bootstrap);
|
||||
};
|
||||
}
|
||||
ChromeUtils.import("resource://normandy/Normandy.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/ShieldRecipeClient.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/PreferenceExperiments.jsm", this);
|
||||
|
||||
const initPref1 = "test.initShieldPrefs1";
|
||||
const initPref2 = "test.initShieldPrefs2";
|
||||
|
@ -31,8 +14,7 @@ const experimentPref3 = "test.initExperimentPrefs3";
|
|||
const experimentPref4 = "test.initExperimentPrefs4";
|
||||
|
||||
decorate_task(
|
||||
withBootstrap,
|
||||
async function testInitShieldPrefs(Bootstrap) {
|
||||
async function testInitShieldPrefs() {
|
||||
const defaultBranch = Services.prefs.getDefaultBranch("");
|
||||
|
||||
const prefDefaults = {
|
||||
|
@ -49,7 +31,7 @@ decorate_task(
|
|||
);
|
||||
}
|
||||
|
||||
Bootstrap.initShieldPrefs(prefDefaults);
|
||||
Normandy.initShieldPrefs(prefDefaults);
|
||||
|
||||
ok(
|
||||
defaultBranch.getBoolPref(initPref1),
|
||||
|
@ -78,10 +60,9 @@ decorate_task(
|
|||
);
|
||||
|
||||
decorate_task(
|
||||
withBootstrap,
|
||||
async function testInitShieldPrefsError(Bootstrap) {
|
||||
async function testInitShieldPrefsError() {
|
||||
Assert.throws(
|
||||
() => Bootstrap.initShieldPrefs({"test.prefTypeError": new Date()}),
|
||||
() => Normandy.initShieldPrefs({"test.prefTypeError": new Date()}),
|
||||
"initShieldPrefs throws when given an invalid type for the pref value.",
|
||||
);
|
||||
},
|
||||
|
@ -96,8 +77,7 @@ decorate_task(
|
|||
],
|
||||
clear: [[experimentPref1], [experimentPref2], [experimentPref3]],
|
||||
}),
|
||||
withBootstrap,
|
||||
async function testInitExperimentPrefs(Bootstrap) {
|
||||
async function testInitExperimentPrefs() {
|
||||
const defaultBranch = Services.prefs.getDefaultBranch("");
|
||||
for (const pref of [experimentPref1, experimentPref2, experimentPref3]) {
|
||||
is(
|
||||
|
@ -107,7 +87,7 @@ decorate_task(
|
|||
);
|
||||
}
|
||||
|
||||
Bootstrap.initExperimentPrefs();
|
||||
Normandy.initExperimentPrefs();
|
||||
|
||||
ok(
|
||||
defaultBranch.getBoolPref(experimentPref1),
|
||||
|
@ -139,11 +119,10 @@ decorate_task(
|
|||
["extensions.shield-recipe-client.startupExperimentPrefs.test.existingPref", "experiment"],
|
||||
],
|
||||
}),
|
||||
withBootstrap,
|
||||
async function testInitExperimentPrefsExisting(Bootstrap) {
|
||||
async function testInitExperimentPrefsExisting() {
|
||||
const defaultBranch = Services.prefs.getDefaultBranch("");
|
||||
defaultBranch.setCharPref("test.existingPref", "default");
|
||||
Bootstrap.initExperimentPrefs();
|
||||
Normandy.initExperimentPrefs();
|
||||
is(
|
||||
defaultBranch.getCharPref("test.existingPref"),
|
||||
"experiment",
|
||||
|
@ -158,11 +137,10 @@ decorate_task(
|
|||
["extensions.shield-recipe-client.startupExperimentPrefs.test.mismatchPref", "experiment"],
|
||||
],
|
||||
}),
|
||||
withBootstrap,
|
||||
async function testInitExperimentPrefsMismatch(Bootstrap) {
|
||||
async function testInitExperimentPrefsMismatch() {
|
||||
const defaultBranch = Services.prefs.getDefaultBranch("");
|
||||
defaultBranch.setIntPref("test.mismatchPref", 2);
|
||||
Bootstrap.initExperimentPrefs();
|
||||
Normandy.initExperimentPrefs();
|
||||
is(
|
||||
defaultBranch.getPrefType("test.mismatchPref"),
|
||||
Services.prefs.PREF_INT,
|
||||
|
@ -172,40 +150,19 @@ decorate_task(
|
|||
);
|
||||
|
||||
decorate_task(
|
||||
withBootstrap,
|
||||
async function testStartupDelayed(Bootstrap) {
|
||||
const finishStartupStub = sinon.stub(Bootstrap, "finishStartup");
|
||||
try {
|
||||
Bootstrap.startup(undefined, 1); // 1 == APP_STARTUP
|
||||
ok(
|
||||
!finishStartupStub.called,
|
||||
"When started at app startup, do not call ShieldRecipeClient.startup immediately.",
|
||||
);
|
||||
withStub(Normandy, "finishInit"),
|
||||
async function testStartupDelayed(finishInitStub) {
|
||||
Normandy.init();
|
||||
ok(
|
||||
!finishInitStub.called,
|
||||
"When initialized, do not call finishInit immediately.",
|
||||
);
|
||||
|
||||
Bootstrap.observe(null, "sessionstore-windows-restored");
|
||||
ok(
|
||||
finishStartupStub.called,
|
||||
"Once the sessionstore-windows-restored event is observed, call ShieldRecipeClient.startup.",
|
||||
);
|
||||
} finally {
|
||||
finishStartupStub.restore();
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
decorate_task(
|
||||
withBootstrap,
|
||||
async function testStartupDelayed(Bootstrap) {
|
||||
const finishStartupStub = sinon.stub(Bootstrap, "finishStartup");
|
||||
try {
|
||||
Bootstrap.startup(undefined, 3); // 3 == ADDON_ENABLED
|
||||
ok(
|
||||
finishStartupStub.called,
|
||||
"When the add-on is enabled outside app startup, call ShieldRecipeClient.startup immediately.",
|
||||
);
|
||||
} finally {
|
||||
finishStartupStub.restore();
|
||||
}
|
||||
Normandy.observe(null, "sessionstore-windows-restored");
|
||||
ok(
|
||||
finishInitStub.called,
|
||||
"Once the sessionstore-windows-restored event is observed, finishInit should be called.",
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
|
@ -227,9 +184,8 @@ decorate_task(
|
|||
["extensions.shield-recipe-client.startupExperimentPrefs.existingPref"],
|
||||
],
|
||||
}),
|
||||
withBootstrap,
|
||||
withStub(PreferenceExperiments, "recordOriginalValues"),
|
||||
async function testInitExperimentPrefs(Bootstrap, recordOriginalValuesStub) {
|
||||
async function testInitExperimentPrefs(recordOriginalValuesStub) {
|
||||
const defaultBranch = Services.prefs.getDefaultBranch("");
|
||||
|
||||
defaultBranch.setBoolPref(experimentPref1, false);
|
||||
|
@ -237,8 +193,8 @@ decorate_task(
|
|||
defaultBranch.setCharPref(experimentPref3, "original string");
|
||||
// experimentPref4 is left unset
|
||||
|
||||
Bootstrap.initExperimentPrefs();
|
||||
await Bootstrap.finishStartup();
|
||||
Normandy.initExperimentPrefs();
|
||||
await Normandy.finishInit();
|
||||
|
||||
Assert.deepEqual(
|
||||
recordOriginalValuesStub.getCall(0).args,
|
||||
|
@ -248,7 +204,7 @@ decorate_task(
|
|||
[experimentPref3]: "original string",
|
||||
[experimentPref4]: null, // null because it was not initially set.
|
||||
}],
|
||||
"finishStartup should record original values of the prefs initExperimentPrefs changed",
|
||||
"finishInit should record original values of the prefs initExperimentPrefs changed",
|
||||
);
|
||||
},
|
||||
);
|
||||
|
@ -261,10 +217,9 @@ decorate_task(
|
|||
["testing.does-not-exist", "foo"],
|
||||
],
|
||||
}),
|
||||
withBootstrap,
|
||||
withStub(PreferenceExperiments, "recordOriginalValues"),
|
||||
async function testInitExperimentPrefsNoDefaultValue(Bootstrap) {
|
||||
Bootstrap.initExperimentPrefs();
|
||||
async function testInitExperimentPrefsNoDefaultValue() {
|
||||
Normandy.initExperimentPrefs();
|
||||
ok(true, "initExperimentPrefs should not throw for non-existant prefs");
|
||||
},
|
||||
);
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
|
||||
ChromeUtils.import("resource://testing-common/AddonTestUtils.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/AddonStudies.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/NormandyDriver.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/PreferenceExperiments.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/AddonStudies.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/NormandyDriver.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/PreferenceExperiments.jsm", this);
|
||||
|
||||
add_task(withDriver(Assert, async function uuids(driver) {
|
||||
// Test that it is a UUID
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
ChromeUtils.import("resource://gre/modules/Preferences.jsm", this);
|
||||
ChromeUtils.import("resource://gre/modules/TelemetryEnvironment.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/PreferenceExperiments.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/CleanupManager.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/TelemetryEvents.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/PreferenceExperiments.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/CleanupManager.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/TelemetryEvents.jsm", this);
|
||||
|
||||
// Save ourselves some typing
|
||||
const {withMockExperiments} = PreferenceExperiments;
|
|
@ -1,13 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://testing-common/TestUtils.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/RecipeRunner.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/ClientEnvironment.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/CleanupManager.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/NormandyApi.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/ActionSandboxManager.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/AddonStudies.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/Uptake.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/RecipeRunner.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/ClientEnvironment.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/CleanupManager.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/NormandyApi.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/ActionSandboxManager.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/AddonStudies.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/Uptake.jsm", this);
|
||||
|
||||
add_task(async function getFilterContext() {
|
||||
const recipe = {id: 17, arguments: {foo: "bar"}, unrelated: false};
|
|
@ -1,7 +1,7 @@
|
|||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/AddonStudies.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/AddonStudies.jsm", this);
|
||||
|
||||
const OPT_OUT_PREF = "app.shield.optoutstudies.enabled";
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/ShieldRecipeClient.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/RecipeRunner.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/PreferenceExperiments.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client-content/AboutPages.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/AddonStudies.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/TelemetryEvents.jsm", this);
|
||||
ChromeUtils.import("resource://normandy-content/AboutPages.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/AddonStudies.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/PreferenceExperiments.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/RecipeRunner.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/ShieldRecipeClient.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/TelemetryEvents.jsm", this);
|
||||
|
||||
function withStubInits(testFunction) {
|
||||
return decorate(
|
|
@ -1,7 +1,7 @@
|
|||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/Storage.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/SandboxManager.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/Storage.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/SandboxManager.jsm", this);
|
||||
|
||||
add_task(async function() {
|
||||
const store1 = new Storage("prefix1");
|
|
@ -1,11 +1,11 @@
|
|||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/AddonStudies.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/RecipeRunner.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client-content/AboutPages.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/AddonStudies.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/RecipeRunner.jsm", this);
|
||||
ChromeUtils.import("resource://normandy-content/AboutPages.jsm", this);
|
||||
|
||||
function withAboutStudies(testFunc) {
|
||||
return async (...args) => (
|
||||
return async (...args) => (
|
||||
BrowserTestUtils.withNewTab("about:studies", async browser => (
|
||||
testFunc(...args, browser)
|
||||
))
|
|
@ -1,12 +1,13 @@
|
|||
ChromeUtils.import("resource://gre/modules/Preferences.jsm", this);
|
||||
ChromeUtils.import("resource://testing-common/AddonTestUtils.jsm", this);
|
||||
ChromeUtils.import("resource://testing-common/TestUtils.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/Addons.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/SandboxManager.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/NormandyDriver.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/NormandyApi.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/TelemetryEvents.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/Utils.jsm", this);
|
||||
ChromeUtils.import("resource://normandy-content/AboutPages.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/Addons.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/SandboxManager.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/NormandyDriver.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/NormandyApi.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/TelemetryEvents.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/Utils.jsm", this);
|
||||
|
||||
// Load mocking/stubbing library, sinon
|
||||
// docs: http://sinonjs.org/docs/
|
|
@ -0,0 +1,12 @@
|
|||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
// ================================================
|
||||
// Load mocking/stubbing library, sinon
|
||||
// docs: http://sinonjs.org/releases/v2.3.2/
|
||||
/* exported sinon */
|
||||
ChromeUtils.import("resource://gre/modules/Timer.jsm");
|
||||
Services.scriptloader.loadSubScript("resource://testing-common/sinon-2.3.2.js", this);
|
||||
/* globals sinon */
|
||||
// ================================================
|
|
@ -5,7 +5,7 @@ ChromeUtils.import("resource://gre/modules/Services.jsm");
|
|||
ChromeUtils.import("resource://testing-common/httpd.js");
|
||||
ChromeUtils.import("resource://gre/modules/CanonicalJSON.jsm", this);
|
||||
ChromeUtils.import("resource://gre/modules/osfile.jsm", this);
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/NormandyApi.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/NormandyApi.jsm", this);
|
||||
|
||||
load("utils.js"); /* globals withMockPreferences */
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/Sampling.jsm", this);
|
||||
ChromeUtils.import("resource://normandy/lib/Sampling.jsm", this);
|
||||
|
||||
add_task(async function testStableSample() {
|
||||
// Absolute samples
|
|
@ -1,6 +1,6 @@
|
|||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://shield-recipe-client/lib/SandboxManager.jsm");
|
||||
ChromeUtils.import("resource://normandy/lib/SandboxManager.jsm");
|
||||
|
||||
// wrapAsync should wrap privileged Promises with Promises that are usable by
|
||||
// the sandbox.
|