mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1021002 - Fix telemetry experiments jsfilter evaluation. r=bsmedberg
This commit is contained in:
parent
593bc7de27
commit
681826282a
@ -326,7 +326,7 @@ Experiments.Policy.prototype = {
|
||||
.healthReporter;
|
||||
yield reporter.onInit();
|
||||
let payload = yield reporter.collectAndObtainJSONPayload();
|
||||
throw new Task.Result(payload);
|
||||
return payload;
|
||||
});
|
||||
},
|
||||
|
||||
@ -1567,10 +1567,6 @@ Experiments.ExperimentEntry.prototype = {
|
||||
};
|
||||
|
||||
let sandbox = Cu.Sandbox(nullprincipal);
|
||||
let context = {};
|
||||
context.healthReportPayload = yield this._policy.healthReportPayload();
|
||||
context.telemetryPayload = yield this._policy.telemetryPayload();
|
||||
|
||||
try {
|
||||
Cu.evalInSandbox(jsfilter, sandbox);
|
||||
} catch (e) {
|
||||
@ -1580,7 +1576,7 @@ Experiments.ExperimentEntry.prototype = {
|
||||
|
||||
// You can't insert arbitrarily complex objects into a sandbox, so
|
||||
// we serialize everything through JSON.
|
||||
sandbox._hr = JSON.stringify(yield this._policy.healthReportPayload());
|
||||
sandbox._hr = yield this._policy.healthReportPayload();
|
||||
Object.defineProperty(sandbox, "_t",
|
||||
{ get: () => JSON.stringify(this._policy.telemetryPayload()) });
|
||||
|
||||
|
@ -45,7 +45,7 @@ add_task(function* test_setup() {
|
||||
|
||||
gReporter = yield getReporter("json_payload_simple");
|
||||
yield gReporter.collectMeasurements();
|
||||
let payload = yield gReporter.getJSONPayload(true);
|
||||
let payload = yield gReporter.getJSONPayload(false);
|
||||
do_register_cleanup(() => gReporter._shutdown());
|
||||
|
||||
patchPolicy(gPolicy, {
|
||||
|
@ -76,7 +76,7 @@ add_task(function* test_setup() {
|
||||
|
||||
gReporter = yield getReporter("json_payload_simple");
|
||||
yield gReporter.collectMeasurements();
|
||||
let payload = yield gReporter.getJSONPayload(true);
|
||||
let payload = yield gReporter.getJSONPayload(false);
|
||||
do_register_cleanup(() => gReporter._shutdown());
|
||||
|
||||
gPolicy = new Experiments.Policy();
|
||||
|
@ -63,7 +63,7 @@ add_task(function* test_setup() {
|
||||
gPolicy = new Experiments.Policy();
|
||||
patchPolicy(gPolicy, {
|
||||
updatechannel: () => "nightly",
|
||||
healthReportPayload: () => {},
|
||||
healthReportPayload: () => "{}",
|
||||
oneshotTimer: (callback, timeout, thisObj, name) => gTimerScheduleOffset = timeout,
|
||||
});
|
||||
});
|
||||
|
@ -55,7 +55,7 @@ add_task(function* test_setup() {
|
||||
|
||||
gReporter = yield getReporter("json_payload_simple");
|
||||
yield gReporter.collectMeasurements();
|
||||
let payload = yield gReporter.getJSONPayload(true);
|
||||
let payload = yield gReporter.getJSONPayload(false);
|
||||
do_register_cleanup(() => gReporter._shutdown());
|
||||
|
||||
patchPolicy(gPolicy, {
|
||||
|
@ -57,7 +57,7 @@ add_task(function* test_setup() {
|
||||
|
||||
gReporter = yield getReporter("json_payload_simple");
|
||||
yield gReporter.collectMeasurements();
|
||||
let payload = yield gReporter.getJSONPayload(true);
|
||||
let payload = yield gReporter.getJSONPayload(false);
|
||||
do_register_cleanup(() => gReporter._shutdown());
|
||||
|
||||
gPolicy = new Experiments.Policy();
|
||||
|
@ -88,7 +88,7 @@ add_task(function* test_setup() {
|
||||
|
||||
gReporter = yield getReporter("json_payload_simple");
|
||||
yield gReporter.collectMeasurements();
|
||||
let payload = yield gReporter.getJSONPayload(true);
|
||||
let payload = yield gReporter.getJSONPayload(false);
|
||||
do_register_cleanup(() => gReporter._shutdown());
|
||||
|
||||
gPolicy = new Experiments.Policy();
|
||||
|
Loading…
Reference in New Issue
Block a user