Bug 1021002 - Fix telemetry experiments jsfilter evaluation. r=bsmedberg

This commit is contained in:
Georg Fritzsche 2014-06-13 14:50:10 +02:00
parent 593bc7de27
commit 681826282a
7 changed files with 8 additions and 12 deletions

View File

@ -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()) });

View File

@ -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, {

View File

@ -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();

View File

@ -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,
});
});

View File

@ -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, {

View File

@ -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();

View File

@ -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();