Bug 818126 - Replace test-enable-load-save-notifications with a function. r=vladan.

This commit is contained in:
Rafael Ávila de Espíndola 2012-12-07 00:38:20 -05:00
parent 9eb559086a
commit f2edc037bf
3 changed files with 6 additions and 4 deletions

View File

@ -956,6 +956,10 @@ TelemetryPing.prototype = {
this.gatherStartupInformation();
},
enableLoadSaveNotifications: function enableLoadSaveNotifications() {
this._doLoadSaveNotifications = true;
},
/**
* This observer drives telemetry.
*/
@ -1022,9 +1026,6 @@ TelemetryPing.prototype = {
this._pingLoadsCompleted = 0;
this.loadHistograms(aSubject.QueryInterface(Ci.nsIFile), aData != "async");
break;
case "test-enable-load-save-notifications":
this._doLoadSaveNotifications = true;
break;
case "test-ping":
server = aData;
// fall through

View File

@ -12,4 +12,5 @@ interface nsITelemetryPing : nsIObserver {
jsval getPayload();
void saveHistograms(in nsIFile aFile, in boolean aSync);
void gatherStartup();
void enableLoadSaveNotifications(); /* Used only for testing. */
};

View File

@ -46,7 +46,7 @@ var gFinished = false;
function telemetry_ping () {
const TelemetryPing = Cc["@mozilla.org/base/telemetry-ping;1"].getService(Ci.nsITelemetryPing);
TelemetryPing.gatherStartup();
TelemetryPing.observe(null, "test-enable-load-save-notifications", null);
TelemetryPing.enableLoadSaveNotifications();
TelemetryPing.observe(null, "test-ping", SERVER);
}