Created
July 12, 2011 17:18
-
-
Save robcee/1078460 to your computer and use it in GitHub Desktop.
webconsole-position-probe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/toolkit/components/telemetry/TelemetryPing.js b/toolkit/components/telemetry/TelemetryPing.js | |
--- a/toolkit/components/telemetry/TelemetryPing.js | |
+++ b/toolkit/components/telemetry/TelemetryPing.js | |
@@ -138,16 +138,17 @@ function getMetadata(reason) { | |
let ret = { | |
reason: reason, | |
OS: ai.OS, | |
appID: ai.ID, | |
appVersion: ai.version, | |
appName: ai.name, | |
appBuildID: ai.appBuildID, | |
platformBuildID: ai.platformBuildID, | |
+ consolePosition: Services.prefs.getCharPref("devtools.webconsole.position"), | |
}; | |
// sysinfo fields is not always available, get what we can. | |
let sysInfo = Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2); | |
let fields = ["cpucount", "memsize", "arch", "version", "device", "manufacturer", "hardware"]; | |
for each (let field in fields) { | |
let value; | |
try { | |
diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryPing.js b/toolkit/components/telemetry/tests/unit/test_TelemetryPing.js | |
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryPing.js | |
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetryPing.js | |
@@ -74,17 +74,18 @@ function checkHistograms(request, respon | |
// get rid of the non-deterministic field | |
const expected_info = { | |
reason: "test-ping", | |
OS: "XPCShell", | |
appID: "[email protected]", | |
appVersion: "1", | |
appName: "XPCShell", | |
appBuildID: "2007010101", | |
- platformBuildID: "2007010101" | |
+ platformBuildID: "2007010101", | |
+ consolePosition: "above" | |
}; | |
for (let f in expected_info) { | |
do_check_eq(payload.info[f], expected_info[f]); | |
} | |
const TELEMETRY_PING = "TELEMETRY_PING"; | |
const TELEMETRY_SUCCESS = "TELEMETRY_SUCCESS"; |
nixed faulty semi-colon, added a test.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Mossop robcee: Where are your tests!