зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset ed070348e5ec (bug 1064333)
This commit is contained in:
Родитель
08957d05e1
Коммит
13adbcf5c4
|
@ -32,7 +32,6 @@ const PREF_BRANCH = "toolkit.telemetry.";
|
|||
const PREF_SERVER = PREF_BRANCH + "server";
|
||||
const PREF_ENABLED = PREF_BRANCH + "enabled";
|
||||
const PREF_PREVIOUS_BUILDID = PREF_BRANCH + "previousBuildID";
|
||||
const PREF_FHR_UPLOAD_ENABLED = "datareporting.healthreport.uploadEnabled";
|
||||
|
||||
// Do not gather data more than once a minute
|
||||
const TELEMETRY_INTERVAL = 60000;
|
||||
|
@ -704,6 +703,7 @@ let Impl = {
|
|||
UIMeasurements: UITelemetry.getUIMeasurements(),
|
||||
log: TelemetryLog.entries(),
|
||||
info: info,
|
||||
clientID: this._clientID,
|
||||
};
|
||||
|
||||
if (Object.keys(this._slowSQLStartup).length != 0 &&
|
||||
|
@ -712,17 +712,6 @@ let Impl = {
|
|||
payloadObj.slowSQLStartup = this._slowSQLStartup;
|
||||
}
|
||||
|
||||
let fhrUploadEnabled = false;
|
||||
try {
|
||||
fhrUploadEnabled = Services.prefs.getBoolPref(PREF_FHR_UPLOAD_ENABLED);
|
||||
} catch (e) {
|
||||
// Pref not set.
|
||||
}
|
||||
|
||||
if (this._clientID && fhrUploadEnabled) {
|
||||
payloadObj.clientID = this._clientID;
|
||||
}
|
||||
|
||||
return payloadObj;
|
||||
},
|
||||
|
||||
|
@ -970,12 +959,10 @@ let Impl = {
|
|||
this.attachObservers();
|
||||
this.gatherMemory();
|
||||
|
||||
if ("@mozilla.org/datareporting/service;1" in Cc) {
|
||||
let drs = Cc["@mozilla.org/datareporting/service;1"]
|
||||
.getService(Ci.nsISupports)
|
||||
.wrappedJSObject;
|
||||
this._clientID = yield drs.getClientID();
|
||||
}
|
||||
let drs = Cc["@mozilla.org/datareporting/service;1"]
|
||||
.getService(Ci.nsISupports)
|
||||
.wrappedJSObject;
|
||||
this._clientID = yield drs.getClientID();
|
||||
|
||||
Telemetry.asyncFetchTelemetryData(function () {});
|
||||
delete this._timer;
|
||||
|
|
|
@ -43,7 +43,6 @@ let gNumberOfThreadsLaunched = 0;
|
|||
|
||||
const PREF_BRANCH = "toolkit.telemetry.";
|
||||
const PREF_ENABLED = PREF_BRANCH + "enabled";
|
||||
const PREF_FHR_UPLOAD_ENABLED = "datareporting.healthreport.uploadEnabled";
|
||||
|
||||
const Telemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);
|
||||
|
||||
|
@ -172,12 +171,9 @@ function checkPayloadInfo(payload, reason) {
|
|||
do_check_true(payload.info.revision.startsWith("http"));
|
||||
}
|
||||
|
||||
if ("@mozilla.org/datareporting/service;1" in Cc &&
|
||||
Services.prefs.getBoolPref(PREF_FHR_UPLOAD_ENABLED)) {
|
||||
do_check_true("clientID" in payload);
|
||||
do_check_neq(payload.clientID, null);
|
||||
do_check_eq(payload.clientID, gDataReportingClientID);
|
||||
}
|
||||
do_check_true("clientID" in payload);
|
||||
do_check_neq(payload.clientID, null);
|
||||
do_check_eq(payload.clientID, gDataReportingClientID);
|
||||
|
||||
try {
|
||||
// If we've not got nsIGfxInfoDebug, then this will throw and stop us doing
|
||||
|
@ -397,14 +393,11 @@ function run_test() {
|
|||
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
|
||||
|
||||
Services.prefs.setBoolPref(PREF_ENABLED, true);
|
||||
Services.prefs.setBoolPref(PREF_FHR_UPLOAD_ENABLED, true);
|
||||
|
||||
// Send the needed startup notifications to the datareporting service
|
||||
// to ensure that it has been initialized.
|
||||
if ("@mozilla.org/datareporting/service;1" in Cc) {
|
||||
gDatareportingService.observe(null, "app-startup", null);
|
||||
gDatareportingService.observe(null, "profile-after-change", null);
|
||||
}
|
||||
gDatareportingService.observe(null, "app-startup", null);
|
||||
gDatareportingService.observe(null, "profile-after-change", null);
|
||||
|
||||
// Make it look like we've previously failed to lock a profile a couple times.
|
||||
write_fake_failedprofilelocks_file();
|
||||
|
@ -455,9 +448,7 @@ function actualTest() {
|
|||
add_task(function* asyncSetup() {
|
||||
yield TelemetryPing.setup();
|
||||
|
||||
if ("@mozilla.org/datareporting/service;1" in Cc) {
|
||||
gDataReportingClientID = yield gDatareportingService.getClientID();
|
||||
}
|
||||
gDataReportingClientID = yield gDatareportingService.getClientID();
|
||||
});
|
||||
|
||||
// Ensure that not overwriting an existing file fails silently
|
||||
|
|
|
@ -74,10 +74,8 @@ function run_test() {
|
|||
|
||||
// Send the needed startup notifications to the datareporting service
|
||||
// to ensure that it has been initialized.
|
||||
if ("@mozilla.org/datareporting/service;1" in Cc) {
|
||||
gDatareportingService.observe(null, "app-startup", null);
|
||||
gDatareportingService.observe(null, "profile-after-change", null);
|
||||
}
|
||||
gDatareportingService.observe(null, "app-startup", null);
|
||||
gDatareportingService.observe(null, "profile-after-change", null);
|
||||
|
||||
run_next_test();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче