mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1136390 - test_TelemetryTimestamps.js/test_conditions.js are missing AddonManager initialization. r=gfritzsche
This commit is contained in:
parent
cbeabf5c9d
commit
b6f213e7a1
@ -153,6 +153,15 @@ function loadAddonManager() {
|
||||
startupManager();
|
||||
}
|
||||
|
||||
// Starts the addon manager without creating app info. We can't directly use
|
||||
// |loadAddonManager| defined above in test_conditions.js as it would make the test fail.
|
||||
function startAddonManagerOnly() {
|
||||
let addonManager = Cc["@mozilla.org/addons/integration;1"]
|
||||
.getService(Ci.nsIObserver)
|
||||
.QueryInterface(Ci.nsITimerCallback);
|
||||
addonManager.observe(null, "addons-startup", null);
|
||||
}
|
||||
|
||||
function getExperimentAddons(previous=false) {
|
||||
let deferred = Promise.defer();
|
||||
|
||||
|
@ -69,6 +69,7 @@ function run_test() {
|
||||
add_task(function* test_setup() {
|
||||
createAppInfo();
|
||||
gProfileDir = do_get_profile();
|
||||
startAddonManagerOnly();
|
||||
yield initialiseTelemetry();
|
||||
gPolicy = new Experiments.Policy();
|
||||
|
||||
|
@ -20,6 +20,18 @@ XPCOMUtils.defineLazyGetter(this, "gDatareportingService",
|
||||
Cu.import("resource://testing-common/AppInfo.jsm");
|
||||
updateAppInfo();
|
||||
|
||||
let gGlobalScope = this;
|
||||
function loadAddonManager() {
|
||||
let ns = {};
|
||||
Cu.import("resource://gre/modules/Services.jsm", ns);
|
||||
let head = "../../../mozapps/extensions/test/xpcshell/head_addons.js";
|
||||
let file = do_get_file(head);
|
||||
let uri = ns.Services.io.newFileURI(file);
|
||||
ns.Services.scriptloader.loadSubScript(uri.spec, gGlobalScope);
|
||||
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
|
||||
startupManager();
|
||||
}
|
||||
|
||||
function getSimpleMeasurementsFromTelemetryPing() {
|
||||
return TelemetrySession.getPayload().simpleMeasurements;
|
||||
}
|
||||
@ -36,6 +48,8 @@ function initialiseTelemetry() {
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
// Telemetry needs the AddonManager.
|
||||
loadAddonManager();
|
||||
// Make profile available for |TelemetrySession.shutdown()|.
|
||||
do_get_profile();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user