Bug 817929 - Remove test-save-histograms and use the existing saveHistograms. r=vladan.

--HG--
extra : rebase_source : b3bf2364720017a69443ec6d426e1cc42c325b62
This commit is contained in:
Rafael Ávila de Espíndola 2012-12-06 21:15:13 -05:00
parent 7596fd6977
commit 8ac08e43de
3 changed files with 6 additions and 6 deletions

View File

@ -1015,9 +1015,6 @@ TelemetryPing.prototype = {
this._isIdleObserver = true;
}).bind(this), Ci.nsIThread.DISPATCH_NORMAL);
break;
case "test-save-histograms":
this.saveHistograms(aSubject.QueryInterface(Ci.nsIFile), aData != "async");
break;
case "test-load-histograms":
this._pingsLoaded = 0;
this._pingLoadsCompleted = 0;

View File

@ -5,7 +5,10 @@
#include "nsIObserver.idl"
interface nsIFile;
[scriptable, uuid(077ee790-3a9d-11e2-81c1-0800200c9a66)]
interface nsITelemetryPing : nsIObserver {
jsval getPayload();
void saveHistograms(in nsIFile aFile, in boolean aSync);
};

View File

@ -100,7 +100,7 @@ function telemetryObserver(aSubject, aTopic, aData) {
setupTestData();
const TelemetryPing = Cc["@mozilla.org/base/telemetry-ping;1"].getService(Ci.nsITelemetryPing);
TelemetryPing.observe(histogramsFile, "test-save-histograms", null);
TelemetryPing.saveHistograms(histogramsFile, true);
TelemetryPing.observe(histogramsFile, "test-load-histograms", null);
telemetry_ping();
}
@ -288,7 +288,7 @@ function runAsyncTestObserver(aSubject, aTopic, aData) {
TelemetryPing.observe(histogramsFile, "test-load-histograms", "async");
}, "telemetry-test-save-complete", false);
TelemetryPing.observe(histogramsFile, "test-save-histograms", "async");
TelemetryPing.saveHistograms(histogramsFile, false);
}
function checkPersistedHistogramsAsync(request, response) {
@ -322,7 +322,7 @@ function runInvalidJSONTest() {
function runOldPingFileTest() {
let histogramsFile = getSavedHistogramsFile("old-histograms.dat");
const TelemetryPing = Cc["@mozilla.org/base/telemetry-ping;1"].getService(Ci.nsITelemetryPing);
TelemetryPing.observe(histogramsFile, "test-save-histograms", null);
TelemetryPing.saveHistograms(histogramsFile, true);
do_check_true(histogramsFile.exists());
let mtime = histogramsFile.lastModifiedTime;