Bug 1109757 - expose update channel and buildID to about:support data gathering, r=MattN,f=cww,gavin

This commit is contained in:
Gijs Kruitbosch 2015-01-28 01:44:14 +00:00
parent 59f922886b
commit 4edd8cb048
3 changed files with 30 additions and 0 deletions

View File

@ -54,6 +54,23 @@ add_task(function*() {
Assert.ok(got.message.extensions, "should have extensions");
Assert.ok(got.message.graphics, "should have graphics");
// Check we have channel and build ID info:
Assert.equal(got.message.application.buildID, Services.appinfo.appBuildID,
"should have correct build ID");
let updateChannel = null;
try {
updateChannel = Cu.import("resource://gre/modules/UpdateChannel.jsm", {}).UpdateChannel.get();
} catch (ex) {}
if (!updateChannel) {
Assert.ok(!('updateChannel' in got.message.application),
"should not have update channel where not available.");
} else {
Assert.equal(got.message.application.updateChannel, updateChannel,
"should have correct update channel.");
}
// And check some keys we know we decline to return.
Assert.ok(!got.message.modifiedPreferences, "should not have a modifiedPreferences key");
Assert.ok(!got.message.crashes, "should not have crash info");

View File

@ -131,10 +131,16 @@ let dataProviders = {
let data = {
name: Services.appinfo.name,
version: Services.appinfo.version,
buildID: Services.appinfo.appBuildID,
userAgent: Cc["@mozilla.org/network/protocol;1?name=http"].
getService(Ci.nsIHttpProtocolHandler).
userAgent,
};
#ifdef MOZ_UPDATER
data.updateChannel = Cu.import("resource://gre/modules/UpdateChannel.jsm", {}).UpdateChannel.get();
#endif
try {
data.vendor = Services.prefs.getCharPref("app.support.vendor");
}

View File

@ -88,6 +88,10 @@ const SNAPSHOT_SCHEMA = {
required: true,
type: "string",
},
buildID: {
required: true,
type: "string",
},
userAgent: {
required: true,
type: "string",
@ -95,6 +99,9 @@ const SNAPSHOT_SCHEMA = {
vendor: {
type: "string",
},
updateChannel: {
type: "string",
},
supportURL: {
type: "string",
},