This commit does several things:
1. It configures a new Nimbus feature and corresponding message group
`backgroundTaskMessage`.
2. It configures `Firefox Messaging Experiments` to use the new
Nimbus feature in background tasks. The existing Remote Settings
collection `nimbus-desktop-experiments` continues to be used.
These configurations are achieved by setting preferences in
`backgroundtasks_browser.js`, which is applied on top of
`firefox.js` prefs by the preference service. These preferences
apply to every background task.
3. It implements functions for enabling Nimbus and the Firefox
Messaging System (and Messaging Experiments) that can be used by
arbitrary background tasks.
It is assumed (but not enforced here) that such tasks will use
non-ephemeral (persistent) profiles, so that Remote Settings
incremental sync, Nimbus bucketing, and Messaging System message
limits, function as expected.
4. It adds a new `message` background task specifically for testing
background task messages. Invoke the testing task with command
lines like `firefox --backgroundtask message ...`.
To ease testing, the framework accepts `--url about:studies?...`
arguments from the Experimenter Web UI to explicitly opt-in to
specific experiment branches.
This task is complicated because it is intended both for QA to
manually invoke, but also to be used by automated tests.
Eventually the existing `backgroundupdate` task will use the new
functions, just as the testing `message` task does.
Differential Revision: https://phabricator.services.mozilla.com/D150521
94 lines
2.3 KiB
Plaintext
94 lines
2.3 KiB
Plaintext
# 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/.
|
|
|
|
with Files("**"):
|
|
BUG_COMPONENT = ("Toolkit", "Background Tasks")
|
|
|
|
SPHINX_TREES["/toolkit/components/backgroundtasks"] = "docs"
|
|
|
|
with Files("docs/**"):
|
|
SCHEDULES.exclusive = ["docs"]
|
|
|
|
FINAL_LIBRARY = "xul"
|
|
|
|
for var in ("MOZ_APP_VENDOR",):
|
|
DEFINES[var] = '"%s"' % CONFIG[var]
|
|
|
|
UNIFIED_SOURCES += [
|
|
"BackgroundTasks.cpp",
|
|
]
|
|
|
|
EXPORTS.mozilla += [
|
|
"BackgroundTasks.h",
|
|
]
|
|
|
|
XPCOM_MANIFESTS += [
|
|
"components.conf",
|
|
]
|
|
|
|
XPIDL_SOURCES += [
|
|
"nsIBackgroundTasks.idl",
|
|
"nsIBackgroundTasksManager.idl",
|
|
]
|
|
|
|
XPIDL_MODULE = "toolkit_backgroundtasks"
|
|
|
|
EXTRA_JS_MODULES += [
|
|
"BackgroundTasksManager.jsm",
|
|
"BackgroundTasksUtils.jsm",
|
|
]
|
|
|
|
EXTRA_JS_MODULES.backgroundtasks += [
|
|
"dbg-actors.js",
|
|
]
|
|
|
|
EXTRA_JS_MODULES.backgroundtasks += [
|
|
"BackgroundTask_exception.jsm",
|
|
"BackgroundTask_failure.jsm",
|
|
"BackgroundTask_message.jsm",
|
|
"BackgroundTask_success.jsm",
|
|
]
|
|
|
|
LOCAL_INCLUDES += [
|
|
"../../profile",
|
|
]
|
|
|
|
BROWSER_CHROME_MANIFESTS += ["tests/browser/browser.ini"]
|
|
XPCSHELL_TESTS_MANIFESTS += ["tests/xpcshell/xpcshell.ini"]
|
|
|
|
TESTING_JS_MODULES += [
|
|
"BackgroundTasksTestUtils.jsm",
|
|
]
|
|
|
|
TESTING_JS_MODULES.backgroundtasks += [
|
|
"tests/BackgroundTask_backgroundtask_specific_pref.jsm",
|
|
"tests/BackgroundTask_crash.jsm",
|
|
"tests/BackgroundTask_file_exists.jsm",
|
|
"tests/BackgroundTask_jsdebugger.jsm",
|
|
"tests/BackgroundTask_localization.jsm",
|
|
"tests/BackgroundTask_not_ephemeral_profile.jsm",
|
|
"tests/BackgroundTask_policies.jsm",
|
|
"tests/BackgroundTask_profile_is_slim.jsm",
|
|
"tests/BackgroundTask_shouldnotprocessupdates.jsm",
|
|
"tests/BackgroundTask_shouldprocessupdates.jsm",
|
|
"tests/BackgroundTask_timeout.jsm",
|
|
"tests/BackgroundTask_unique_profile.jsm",
|
|
"tests/BackgroundTask_update_sync_manager.jsm",
|
|
"tests/BackgroundTask_wait.jsm",
|
|
]
|
|
|
|
if CONFIG["MOZ_BUILD_APP"] == "browser":
|
|
# ASRouter is Firefox-only.
|
|
TESTING_JS_MODULES.backgroundtasks += [
|
|
"tests/BackgroundTask_targeting.jsm",
|
|
]
|
|
|
|
FINAL_TARGET_FILES.browser.defaults.backgroundtasks += [
|
|
"defaults/backgroundtasks_browser.js",
|
|
]
|
|
|
|
FINAL_TARGET_FILES.defaults.backgroundtasks += [
|
|
"defaults/backgroundtasks.js",
|
|
]
|