only use our experimentPing outside of Test Pilot

This commit is contained in:
groovecoder
2017-05-19 13:38:04 -05:00
parent 3700e6f461
commit 5916bd2871
2 changed files with 8 additions and 16 deletions
+8 -15
View File
@@ -82,21 +82,14 @@ function experimentPing(event) {
}
function Experiment() {
Events.on(EVENT_SEND_METRIC, experimentPing);
// If the user has @testpilot-addon, it already bound
// experimentPing to testpilot::send-metric,
// so we don't need to bind this one
AddonManager.getAddonByID('@testpilot-addon', addon => {
if (!addon) {
Events.on(EVENT_SEND_METRIC, experimentPing);
}
});
}
Experiment.prototype = {
constructor: function() {
Events.on(EVENT_SEND_METRIC, experimentPing);
},
ping: function(event) {
experimentPing(event);
},
teardown: function() {
Events.off(EVENT_SEND_METRIC, experimentPing);
}
};
module.exports = Experiment;