Skip to content

Instantly share code, notes, and snippets.

@robcee
Created July 12, 2011 17:18
Show Gist options
  • Save robcee/1078460 to your computer and use it in GitHub Desktop.
Save robcee/1078460 to your computer and use it in GitHub Desktop.
webconsole-position-probe
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";
@robcee
Copy link
Author

robcee commented Jul 12, 2011

@Mossop robcee: Where are your tests!

@robcee
Copy link
Author

robcee commented Jul 12, 2011

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