mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1098374 - Telemetry: Stop all monkey patching in devtools telemetry tests r=harth
This commit is contained in:
parent
aa00bffdf3
commit
5eaccd37d2
@ -15,8 +15,6 @@ const promise = Cu.import("resource://gre/modules/Promise.jsm", {}).Promise;
|
|||||||
const EventEmitter = require("devtools/toolkit/event-emitter");
|
const EventEmitter = require("devtools/toolkit/event-emitter");
|
||||||
const { CallWatcherFront } = require("devtools/server/actors/call-watcher");
|
const { CallWatcherFront } = require("devtools/server/actors/call-watcher");
|
||||||
const { CanvasFront } = require("devtools/server/actors/canvas");
|
const { CanvasFront } = require("devtools/server/actors/canvas");
|
||||||
const Telemetry = require("devtools/shared/telemetry");
|
|
||||||
const telemetry = new Telemetry();
|
|
||||||
|
|
||||||
XPCOMUtils.defineLazyModuleGetter(this, "Task",
|
XPCOMUtils.defineLazyModuleGetter(this, "Task",
|
||||||
"resource://gre/modules/Task.jsm");
|
"resource://gre/modules/Task.jsm");
|
||||||
@ -122,7 +120,6 @@ let EventsHandler = {
|
|||||||
* Listen for events emitted by the current tab target.
|
* Listen for events emitted by the current tab target.
|
||||||
*/
|
*/
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
telemetry.toolOpened("canvasdebugger");
|
|
||||||
this._onTabNavigated = this._onTabNavigated.bind(this);
|
this._onTabNavigated = this._onTabNavigated.bind(this);
|
||||||
gTarget.on("will-navigate", this._onTabNavigated);
|
gTarget.on("will-navigate", this._onTabNavigated);
|
||||||
gTarget.on("navigate", this._onTabNavigated);
|
gTarget.on("navigate", this._onTabNavigated);
|
||||||
@ -132,7 +129,6 @@ let EventsHandler = {
|
|||||||
* Remove events emitted by the current tab target.
|
* Remove events emitted by the current tab target.
|
||||||
*/
|
*/
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
telemetry.toolClosed("canvasdebugger");
|
|
||||||
gTarget.off("will-navigate", this._onTabNavigated);
|
gTarget.off("will-navigate", this._onTabNavigated);
|
||||||
gTarget.off("navigate", this._onTabNavigated);
|
gTarget.off("navigate", this._onTabNavigated);
|
||||||
},
|
},
|
||||||
|
@ -16,8 +16,6 @@ const promise = Cu.import("resource://gre/modules/Promise.jsm", {}).Promise;
|
|||||||
const EventEmitter = require("devtools/toolkit/event-emitter");
|
const EventEmitter = require("devtools/toolkit/event-emitter");
|
||||||
const {Tooltip} = require("devtools/shared/widgets/Tooltip");
|
const {Tooltip} = require("devtools/shared/widgets/Tooltip");
|
||||||
const Editor = require("devtools/sourceeditor/editor");
|
const Editor = require("devtools/sourceeditor/editor");
|
||||||
const Telemetry = require("devtools/shared/telemetry");
|
|
||||||
const telemetry = new Telemetry();
|
|
||||||
|
|
||||||
// The panel's window global is an EventEmitter firing the following events:
|
// The panel's window global is an EventEmitter firing the following events:
|
||||||
const EVENTS = {
|
const EVENTS = {
|
||||||
@ -85,7 +83,6 @@ let EventsHandler = {
|
|||||||
* Listen for events emitted by the current tab target.
|
* Listen for events emitted by the current tab target.
|
||||||
*/
|
*/
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
telemetry.toolOpened("shadereditor");
|
|
||||||
this._onHostChanged = this._onHostChanged.bind(this);
|
this._onHostChanged = this._onHostChanged.bind(this);
|
||||||
this._onTabNavigated = this._onTabNavigated.bind(this);
|
this._onTabNavigated = this._onTabNavigated.bind(this);
|
||||||
this._onProgramLinked = this._onProgramLinked.bind(this);
|
this._onProgramLinked = this._onProgramLinked.bind(this);
|
||||||
@ -101,7 +98,6 @@ let EventsHandler = {
|
|||||||
* Remove events emitted by the current tab target.
|
* Remove events emitted by the current tab target.
|
||||||
*/
|
*/
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
telemetry.toolClosed("shadereditor");
|
|
||||||
gToolbox.off("host-changed", this._onHostChanged);
|
gToolbox.off("host-changed", this._onHostChanged);
|
||||||
gTarget.off("will-navigate", this._onTabNavigated);
|
gTarget.off("will-navigate", this._onTabNavigated);
|
||||||
gTarget.off("navigate", this._onTabNavigated);
|
gTarget.off("navigate", this._onTabNavigated);
|
||||||
|
@ -19,17 +19,8 @@
|
|||||||
* timerHistogram: "DEVTOOLS_MYTOOLNAME_TIME_ACTIVE_SECONDS"
|
* timerHistogram: "DEVTOOLS_MYTOOLNAME_TIME_ACTIVE_SECONDS"
|
||||||
* },
|
* },
|
||||||
*
|
*
|
||||||
* 3. Include this module at the top of your tool. Use:
|
* 3. toolbox.js will automatically ping telemetry with your tools opening and
|
||||||
* let Telemetry = require("devtools/shared/telemetry")
|
* timing information.
|
||||||
*
|
|
||||||
* 4. Create a telemetry instance in your tool's constructor:
|
|
||||||
* this._telemetry = new Telemetry();
|
|
||||||
*
|
|
||||||
* 5. When your tool is opened call:
|
|
||||||
* this._telemetry.toolOpened("mytoolname");
|
|
||||||
*
|
|
||||||
* 6. When your tool is closed call:
|
|
||||||
* this._telemetry.toolClosed("mytoolname");
|
|
||||||
*
|
*
|
||||||
* Note:
|
* Note:
|
||||||
* You can view telemetry stats for your local Firefox instance via
|
* You can view telemetry stats for your local Firefox instance via
|
||||||
@ -303,6 +294,10 @@ Telemetry.prototype = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
clearToolsOpenedPref: function() {
|
||||||
|
Services.prefs.clearUserPref(TOOLS_OPENED_PREF);
|
||||||
|
},
|
||||||
|
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
for (let histogramId of this._timers.keys()) {
|
for (let histogramId of this._timers.keys()) {
|
||||||
this.stopTimer(histogramId);
|
this.stopTimer(histogramId);
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
let tmp = {};
|
let ObservableObject = devtools.require("devtools/shared/observable-object");
|
||||||
Cu.import("resource://gre/modules/devtools/Loader.jsm", tmp);
|
|
||||||
let ObservableObject = tmp.devtools.require("devtools/shared/observable-object");
|
|
||||||
|
|
||||||
let rawObject = {};
|
let rawObject = {};
|
||||||
let oe = new ObservableObject(rawObject);
|
let oe = new ObservableObject(rawObject);
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
// Tests that options-view OptionsView responds to events correctly.
|
// Tests that options-view OptionsView responds to events correctly.
|
||||||
|
|
||||||
const {OptionsView} = devtools.require("devtools/shared/options-view");
|
const {OptionsView} = devtools.require("devtools/shared/options-view");
|
||||||
const {Services} = devtools.require("resource://gre/modules/Services.jsm");
|
|
||||||
|
|
||||||
const BRANCH = "devtools.debugger.";
|
const BRANCH = "devtools.debugger.";
|
||||||
const BLACK_BOX_PREF = "auto-black-box";
|
const BLACK_BOX_PREF = "auto-black-box";
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
/* Any copyright is dedicated to the Public Domain.
|
/* Any copyright is dedicated to the Public Domain.
|
||||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
|
|
||||||
let {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
|
|
||||||
let {Loader} = Cu.import("resource://gre/modules/commonjs/toolkit/loader.js", {});
|
|
||||||
let {OutputParser} = devtools.require("devtools/output-parser");
|
let {OutputParser} = devtools.require("devtools/output-parser");
|
||||||
|
|
||||||
add_task(function*() {
|
add_task(function*() {
|
||||||
|
@ -8,50 +8,41 @@ let {EyedropperManager} = require("devtools/eyedropper/eyedropper");
|
|||||||
|
|
||||||
add_task(function*() {
|
add_task(function*() {
|
||||||
yield promiseTab(TEST_URI);
|
yield promiseTab(TEST_URI);
|
||||||
let Telemetry = loadTelemetryAndRecordLogs();
|
|
||||||
|
startTelemetry();
|
||||||
|
|
||||||
let target = TargetFactory.forTab(gBrowser.selectedTab);
|
let target = TargetFactory.forTab(gBrowser.selectedTab);
|
||||||
let toolbox = yield gDevTools.showToolbox(target, "inspector");
|
let toolbox = yield gDevTools.showToolbox(target, "inspector");
|
||||||
info("inspector opened");
|
info("inspector opened");
|
||||||
|
|
||||||
info("testing the eyedropper button");
|
info("testing the eyedropper button");
|
||||||
testButton(toolbox, Telemetry);
|
testButton(toolbox);
|
||||||
|
|
||||||
stopRecordingTelemetryLogs(Telemetry);
|
|
||||||
yield gDevTools.closeToolbox(target);
|
yield gDevTools.closeToolbox(target);
|
||||||
gBrowser.removeCurrentTab();
|
gBrowser.removeCurrentTab();
|
||||||
});
|
});
|
||||||
|
|
||||||
function testButton(toolbox, Telemetry) {
|
function testButton(toolbox) {
|
||||||
let button = toolbox.doc.querySelector("#command-button-eyedropper");
|
let button = toolbox.doc.querySelector("#command-button-eyedropper");
|
||||||
ok(button, "Captain, we have the eyedropper button");
|
ok(button, "Captain, we have the eyedropper button");
|
||||||
|
|
||||||
info("clicking the button to open the eyedropper");
|
info("clicking the button to open the eyedropper");
|
||||||
button.click();
|
button.click();
|
||||||
|
|
||||||
checkResults("_EYEDROPPER_", Telemetry);
|
checkResults();
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkResults(histIdFocus, Telemetry) {
|
function checkResults() {
|
||||||
let result = Telemetry.prototype.telemetryInfo;
|
// For help generating these tests use generateTelemetryTests("DEVTOOLS_")
|
||||||
|
// here.
|
||||||
for (let [histId, value] of Iterator(result)) {
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_LISTTABS_MS", null, "hasentries");
|
||||||
if (histId.startsWith("DEVTOOLS_INSPECTOR_") ||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_RECONFIGURETAB_MS", null, "hasentries");
|
||||||
!histId.contains(histIdFocus)) {
|
checkTelemetry("DEVTOOLS_EYEDROPPER_OPENED_BOOLEAN", [0,1,0]);
|
||||||
// Inspector stats are tested in
|
checkTelemetry("DEVTOOLS_EYEDROPPER_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
// browser_telemetry_toolboxtabs_{toolname}.js so we skip them here
|
checkTelemetry("DEVTOOLS_INSPECTOR_OPENED_BOOLEAN", [0,1,0]);
|
||||||
// because we only open the inspector once for this test.
|
checkTelemetry("DEVTOOLS_INSPECTOR_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
continue;
|
checkTelemetry("DEVTOOLS_RULEVIEW_OPENED_BOOLEAN", [0,1,0]);
|
||||||
}
|
checkTelemetry("DEVTOOLS_RULEVIEW_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_BOOLEAN", [0,1,0]);
|
||||||
if (histId.endsWith("OPENED_PER_USER_FLAG")) {
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
ok(value.length === 1 && value[0] === true,
|
|
||||||
"Per user value " + histId + " has a single value of true");
|
|
||||||
} else if (histId.endsWith("OPENED_BOOLEAN")) {
|
|
||||||
is(value.length, 1, histId + " has one entry");
|
|
||||||
|
|
||||||
let okay = value.every(element => element === true);
|
|
||||||
ok(okay, "All " + histId + " entries are === true");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -10,28 +10,28 @@ const TOOL_DELAY = 200;
|
|||||||
|
|
||||||
add_task(function*() {
|
add_task(function*() {
|
||||||
yield promiseTab(TEST_URI);
|
yield promiseTab(TEST_URI);
|
||||||
let Telemetry = loadTelemetryAndRecordLogs();
|
|
||||||
|
startTelemetry();
|
||||||
|
|
||||||
let target = TargetFactory.forTab(gBrowser.selectedTab);
|
let target = TargetFactory.forTab(gBrowser.selectedTab);
|
||||||
let toolbox = yield gDevTools.showToolbox(target, "inspector");
|
let toolbox = yield gDevTools.showToolbox(target, "inspector");
|
||||||
info("inspector opened");
|
info("inspector opened");
|
||||||
|
|
||||||
info("testing the paintflashing button");
|
info("testing the paintflashing button");
|
||||||
yield testButton(toolbox, Telemetry);
|
yield testButton(toolbox);
|
||||||
|
|
||||||
stopRecordingTelemetryLogs(Telemetry);
|
|
||||||
yield gDevTools.closeToolbox(target);
|
yield gDevTools.closeToolbox(target);
|
||||||
gBrowser.removeCurrentTab();
|
gBrowser.removeCurrentTab();
|
||||||
});
|
});
|
||||||
|
|
||||||
function* testButton(toolbox, Telemetry) {
|
function* testButton(toolbox) {
|
||||||
info("Testing command-button-paintflashing");
|
info("Testing command-button-paintflashing");
|
||||||
|
|
||||||
let button = toolbox.doc.querySelector("#command-button-paintflashing");
|
let button = toolbox.doc.querySelector("#command-button-paintflashing");
|
||||||
ok(button, "Captain, we have the button");
|
ok(button, "Captain, we have the button");
|
||||||
|
|
||||||
yield delayedClicks(button, 4);
|
yield delayedClicks(button, 4);
|
||||||
checkResults("_PAINTFLASHING_", Telemetry);
|
checkResults();
|
||||||
}
|
}
|
||||||
|
|
||||||
function delayedClicks(node, clicks) {
|
function delayedClicks(node, clicks) {
|
||||||
@ -53,37 +53,19 @@ function delayedClicks(node, clicks) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkResults(histIdFocus, Telemetry) {
|
function checkResults(histIdFocus) {
|
||||||
let result = Telemetry.prototype.telemetryInfo;
|
// For help generating these tests use generateTelemetryTests("DEVTOOLS_")
|
||||||
|
// here.
|
||||||
for (let [histId, value] of Iterator(result)) {
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_LISTTABS_MS", null, "hasentries");
|
||||||
if (histId.startsWith("DEVTOOLS_INSPECTOR_") ||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_PROTOCOLDESCRIPTION_MS", null, "hasentries");
|
||||||
!histId.contains(histIdFocus)) {
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_RECONFIGURETAB_MS", null, "hasentries");
|
||||||
// Inspector stats are tested in
|
checkTelemetry("DEVTOOLS_INSPECTOR_OPENED_BOOLEAN", [0,1,0]);
|
||||||
// browser_telemetry_toolboxtabs_{toolname}.js so we skip them here
|
checkTelemetry("DEVTOOLS_INSPECTOR_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
// because we only open the inspector once for this test.
|
checkTelemetry("DEVTOOLS_PAINTFLASHING_OPENED_BOOLEAN", [0,2,0]);
|
||||||
continue;
|
checkTelemetry("DEVTOOLS_PAINTFLASHING_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
}
|
checkTelemetry("DEVTOOLS_PAINTFLASHING_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_RULEVIEW_OPENED_BOOLEAN", [0,1,0]);
|
||||||
if (histId.endsWith("OPENED_PER_USER_FLAG")) {
|
checkTelemetry("DEVTOOLS_RULEVIEW_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
ok(value.length === 1 && value[0] === true,
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_BOOLEAN", [0,1,0]);
|
||||||
"Per user value " + histId + " has a single value of true");
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
} else if (histId.endsWith("OPENED_BOOLEAN")) {
|
|
||||||
ok(value.length > 1, histId + " has more than one entry");
|
|
||||||
|
|
||||||
let okay = value.every(function(element) {
|
|
||||||
return element === true;
|
|
||||||
});
|
|
||||||
|
|
||||||
ok(okay, "All " + histId + " entries are === true");
|
|
||||||
} else if (histId.endsWith("TIME_ACTIVE_SECONDS")) {
|
|
||||||
ok(value.length > 1, histId + " has more than one entry");
|
|
||||||
|
|
||||||
let okay = value.every(function(element) {
|
|
||||||
return element > 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
ok(okay, "All " + histId + " entries have time > 0");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -10,28 +10,28 @@ const TOOL_DELAY = 200;
|
|||||||
|
|
||||||
add_task(function*() {
|
add_task(function*() {
|
||||||
yield promiseTab(TEST_URI);
|
yield promiseTab(TEST_URI);
|
||||||
let Telemetry = loadTelemetryAndRecordLogs();
|
|
||||||
|
startTelemetry();
|
||||||
|
|
||||||
let target = TargetFactory.forTab(gBrowser.selectedTab);
|
let target = TargetFactory.forTab(gBrowser.selectedTab);
|
||||||
let toolbox = yield gDevTools.showToolbox(target, "inspector");
|
let toolbox = yield gDevTools.showToolbox(target, "inspector");
|
||||||
info("inspector opened");
|
info("inspector opened");
|
||||||
|
|
||||||
info("testing the responsivedesign button");
|
info("testing the responsivedesign button");
|
||||||
yield testButton(toolbox, Telemetry);
|
yield testButton(toolbox);
|
||||||
|
|
||||||
stopRecordingTelemetryLogs(Telemetry);
|
|
||||||
yield gDevTools.closeToolbox(target);
|
yield gDevTools.closeToolbox(target);
|
||||||
gBrowser.removeCurrentTab();
|
gBrowser.removeCurrentTab();
|
||||||
});
|
});
|
||||||
|
|
||||||
function* testButton(toolbox, Telemetry) {
|
function* testButton(toolbox) {
|
||||||
info("Testing command-button-responsive");
|
info("Testing command-button-responsive");
|
||||||
|
|
||||||
let button = toolbox.doc.querySelector("#command-button-responsive");
|
let button = toolbox.doc.querySelector("#command-button-responsive");
|
||||||
ok(button, "Captain, we have the button");
|
ok(button, "Captain, we have the button");
|
||||||
|
|
||||||
yield delayedClicks(button, 4);
|
yield delayedClicks(button, 4);
|
||||||
checkResults("_RESPONSIVE_", Telemetry);
|
checkResults();
|
||||||
}
|
}
|
||||||
|
|
||||||
function delayedClicks(node, clicks) {
|
function delayedClicks(node, clicks) {
|
||||||
@ -53,37 +53,19 @@ function delayedClicks(node, clicks) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkResults(histIdFocus, Telemetry) {
|
function checkResults() {
|
||||||
let result = Telemetry.prototype.telemetryInfo;
|
// For help generating these tests use generateTelemetryTests("DEVTOOLS_")
|
||||||
|
// here.
|
||||||
for (let [histId, value] of Iterator(result)) {
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_LISTTABS_MS", null, "hasentries");
|
||||||
if (histId.startsWith("DEVTOOLS_INSPECTOR_") ||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_PROTOCOLDESCRIPTION_MS", null, "hasentries");
|
||||||
!histId.contains(histIdFocus)) {
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_RECONFIGURETAB_MS", null, "hasentries");
|
||||||
// Inspector stats are tested in
|
checkTelemetry("DEVTOOLS_INSPECTOR_OPENED_BOOLEAN", [0,1,0]);
|
||||||
// browser_telemetry_toolboxtabs_{toolname}.js so we skip them here
|
checkTelemetry("DEVTOOLS_INSPECTOR_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
// because we only open the inspector once for this test.
|
checkTelemetry("DEVTOOLS_RESPONSIVE_OPENED_BOOLEAN", [0,2,0]);
|
||||||
continue;
|
checkTelemetry("DEVTOOLS_RESPONSIVE_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
}
|
checkTelemetry("DEVTOOLS_RESPONSIVE_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_RULEVIEW_OPENED_BOOLEAN", [0,1,0]);
|
||||||
if (histId.endsWith("OPENED_PER_USER_FLAG")) {
|
checkTelemetry("DEVTOOLS_RULEVIEW_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
ok(value.length === 1 && value[0] === true,
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_BOOLEAN", [0,1,0]);
|
||||||
"Per user value " + histId + " has a single value of true");
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
} else if (histId.endsWith("OPENED_BOOLEAN")) {
|
|
||||||
ok(value.length > 1, histId + " has more than one entry");
|
|
||||||
|
|
||||||
let okay = value.every(function(element) {
|
|
||||||
return element === true;
|
|
||||||
});
|
|
||||||
|
|
||||||
ok(okay, "All " + histId + " entries are === true");
|
|
||||||
} else if (histId.endsWith("TIME_ACTIVE_SECONDS")) {
|
|
||||||
ok(value.length > 1, histId + " has more than one entry");
|
|
||||||
|
|
||||||
let okay = value.every(function(element) {
|
|
||||||
return element > 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
ok(okay, "All " + histId + " entries have time > 0");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,8 @@ const TOOL_DELAY = 200;
|
|||||||
|
|
||||||
add_task(function*() {
|
add_task(function*() {
|
||||||
yield promiseTab(TEST_URI);
|
yield promiseTab(TEST_URI);
|
||||||
let Telemetry = loadTelemetryAndRecordLogs();
|
|
||||||
|
startTelemetry();
|
||||||
|
|
||||||
let target = TargetFactory.forTab(gBrowser.selectedTab);
|
let target = TargetFactory.forTab(gBrowser.selectedTab);
|
||||||
let toolbox = yield gDevTools.showToolbox(target, "inspector");
|
let toolbox = yield gDevTools.showToolbox(target, "inspector");
|
||||||
@ -19,12 +20,11 @@ add_task(function*() {
|
|||||||
let onAllWindowsOpened = trackScratchpadWindows();
|
let onAllWindowsOpened = trackScratchpadWindows();
|
||||||
|
|
||||||
info("testing the scratchpad button");
|
info("testing the scratchpad button");
|
||||||
yield testButton(toolbox, Telemetry);
|
yield testButton(toolbox);
|
||||||
yield onAllWindowsOpened;
|
yield onAllWindowsOpened;
|
||||||
|
|
||||||
checkResults("_SCRATCHPAD_", Telemetry);
|
checkResults();
|
||||||
|
|
||||||
stopRecordingTelemetryLogs(Telemetry);
|
|
||||||
yield gDevTools.closeToolbox(target);
|
yield gDevTools.closeToolbox(target);
|
||||||
gBrowser.removeCurrentTab();
|
gBrowser.removeCurrentTab();
|
||||||
});
|
});
|
||||||
@ -64,7 +64,7 @@ function trackScratchpadWindows() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function* testButton(toolbox, Telemetry) {
|
function* testButton(toolbox) {
|
||||||
info("Testing command-button-scratchpad");
|
info("Testing command-button-scratchpad");
|
||||||
let button = toolbox.doc.querySelector("#command-button-scratchpad");
|
let button = toolbox.doc.querySelector("#command-button-scratchpad");
|
||||||
ok(button, "Captain, we have the button");
|
ok(button, "Captain, we have the button");
|
||||||
@ -91,37 +91,18 @@ function delayedClicks(node, clicks) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkResults(histIdFocus, Telemetry) {
|
function checkResults(histIdFocus) {
|
||||||
let result = Telemetry.prototype.telemetryInfo;
|
// For help generating these tests use generateTelemetryTests("DEVTOOLS_")
|
||||||
|
// here.
|
||||||
for (let [histId, value] of Iterator(result)) {
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_LISTTABS_MS", null, "hasentries");
|
||||||
if (histId.startsWith("DEVTOOLS_INSPECTOR_") ||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_PROTOCOLDESCRIPTION_MS", null, "hasentries");
|
||||||
!histId.contains(histIdFocus)) {
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_RECONFIGURETAB_MS", null, "hasentries");
|
||||||
// Inspector stats are tested in
|
checkTelemetry("DEVTOOLS_INSPECTOR_OPENED_BOOLEAN", [0,1,0]);
|
||||||
// browser_telemetry_toolboxtabs_{toolname}.js so we skip them here
|
checkTelemetry("DEVTOOLS_INSPECTOR_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
// because we only open the inspector once for this test.
|
checkTelemetry("DEVTOOLS_RULEVIEW_OPENED_BOOLEAN", [0,1,0]);
|
||||||
continue;
|
checkTelemetry("DEVTOOLS_RULEVIEW_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
}
|
checkTelemetry("DEVTOOLS_SCRATCHPAD_OPENED_BOOLEAN", [0,4,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_SCRATCHPAD_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
if (histId.endsWith("OPENED_PER_USER_FLAG")) {
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_BOOLEAN", [0,1,0]);
|
||||||
ok(value.length === 1 && value[0] === true,
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
"Per user value " + histId + " has a single value of true");
|
|
||||||
} else if (histId.endsWith("OPENED_BOOLEAN")) {
|
|
||||||
ok(value.length > 1, histId + " has more than one entry");
|
|
||||||
|
|
||||||
let okay = value.every(function(element) {
|
|
||||||
return element === true;
|
|
||||||
});
|
|
||||||
|
|
||||||
ok(okay, "All " + histId + " entries are === true");
|
|
||||||
} else if (histId.endsWith("TIME_ACTIVE_SECONDS")) {
|
|
||||||
ok(value.length > 1, histId + " has more than one entry");
|
|
||||||
|
|
||||||
let okay = value.every(function(element) {
|
|
||||||
return element > 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
ok(okay, "All " + histId + " entries have time > 0");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -10,28 +10,28 @@ const TOOL_DELAY = 200;
|
|||||||
|
|
||||||
add_task(function*() {
|
add_task(function*() {
|
||||||
yield promiseTab(TEST_URI);
|
yield promiseTab(TEST_URI);
|
||||||
let Telemetry = loadTelemetryAndRecordLogs();
|
|
||||||
|
startTelemetry();
|
||||||
|
|
||||||
let target = TargetFactory.forTab(gBrowser.selectedTab);
|
let target = TargetFactory.forTab(gBrowser.selectedTab);
|
||||||
let toolbox = yield gDevTools.showToolbox(target, "inspector");
|
let toolbox = yield gDevTools.showToolbox(target, "inspector");
|
||||||
info("inspector opened");
|
info("inspector opened");
|
||||||
|
|
||||||
info("testing the tilt button");
|
info("testing the tilt button");
|
||||||
yield testButton(toolbox, Telemetry);
|
yield testButton(toolbox);
|
||||||
|
|
||||||
stopRecordingTelemetryLogs(Telemetry);
|
|
||||||
yield gDevTools.closeToolbox(target);
|
yield gDevTools.closeToolbox(target);
|
||||||
gBrowser.removeCurrentTab();
|
gBrowser.removeCurrentTab();
|
||||||
});
|
});
|
||||||
|
|
||||||
function* testButton(toolbox, Telemetry) {
|
function* testButton(toolbox) {
|
||||||
info("Testing command-button-tilt");
|
info("Testing command-button-tilt");
|
||||||
|
|
||||||
let button = toolbox.doc.querySelector("#command-button-tilt");
|
let button = toolbox.doc.querySelector("#command-button-tilt");
|
||||||
ok(button, "Captain, we have the button");
|
ok(button, "Captain, we have the button");
|
||||||
|
|
||||||
yield delayedClicks(button, 4)
|
yield delayedClicks(button, 4);
|
||||||
checkResults("_TILT_", Telemetry);
|
checkResults();
|
||||||
}
|
}
|
||||||
|
|
||||||
function delayedClicks(node, clicks) {
|
function delayedClicks(node, clicks) {
|
||||||
@ -53,37 +53,19 @@ function delayedClicks(node, clicks) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkResults(histIdFocus, Telemetry) {
|
function checkResults() {
|
||||||
let result = Telemetry.prototype.telemetryInfo;
|
// For help generating these tests use generateTelemetryTests("DEVTOOLS_")
|
||||||
|
// here.
|
||||||
for (let [histId, value] of Iterator(result)) {
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_LISTTABS_MS", null, "hasentries");
|
||||||
if (histId.startsWith("DEVTOOLS_INSPECTOR_") ||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_PROTOCOLDESCRIPTION_MS", null, "hasentries");
|
||||||
!histId.contains(histIdFocus)) {
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_RECONFIGURETAB_MS", null, "hasentries");
|
||||||
// Inspector stats are tested in
|
checkTelemetry("DEVTOOLS_INSPECTOR_OPENED_BOOLEAN", [0,1,0]);
|
||||||
// browser_telemetry_toolboxtabs_{toolname}.js so we skip them here
|
checkTelemetry("DEVTOOLS_INSPECTOR_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
// because we only open the inspector once for this test.
|
checkTelemetry("DEVTOOLS_RULEVIEW_OPENED_BOOLEAN", [0,1,0]);
|
||||||
continue;
|
checkTelemetry("DEVTOOLS_RULEVIEW_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
}
|
checkTelemetry("DEVTOOLS_TILT_OPENED_BOOLEAN", [0,2,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_TILT_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
if (histId.endsWith("OPENED_PER_USER_FLAG")) {
|
checkTelemetry("DEVTOOLS_TILT_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
ok(value.length === 1 && value[0] === true,
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_BOOLEAN", [0,1,0]);
|
||||||
"Per user value " + histId + " has a single value of true");
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
} else if (histId.endsWith("OPENED_BOOLEAN")) {
|
|
||||||
ok(value.length > 1, histId + " has more than one entry");
|
|
||||||
|
|
||||||
let okay = value.every(function(element) {
|
|
||||||
return element === true;
|
|
||||||
});
|
|
||||||
|
|
||||||
ok(okay, "All " + histId + " entries are === true");
|
|
||||||
} else if (histId.endsWith("TIME_ACTIVE_SECONDS")) {
|
|
||||||
ok(value.length > 1, histId + " has more than one entry");
|
|
||||||
|
|
||||||
let okay = value.every(function(element) {
|
|
||||||
return element > 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
ok(okay, "All " + histId + " entries have time > 0");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -9,16 +9,16 @@ const TOOL_DELAY = 200;
|
|||||||
|
|
||||||
add_task(function*() {
|
add_task(function*() {
|
||||||
yield promiseTab(TEST_URI);
|
yield promiseTab(TEST_URI);
|
||||||
let Telemetry = loadTelemetryAndRecordLogs();
|
|
||||||
|
startTelemetry();
|
||||||
|
|
||||||
let target = TargetFactory.forTab(gBrowser.selectedTab);
|
let target = TargetFactory.forTab(gBrowser.selectedTab);
|
||||||
let toolbox = yield gDevTools.showToolbox(target, "inspector");
|
let toolbox = yield gDevTools.showToolbox(target, "inspector");
|
||||||
info("inspector opened");
|
info("inspector opened");
|
||||||
|
|
||||||
yield testSidebar(toolbox);
|
yield testSidebar(toolbox);
|
||||||
checkResults(Telemetry);
|
checkResults();
|
||||||
|
|
||||||
stopRecordingTelemetryLogs(Telemetry);
|
|
||||||
yield gDevTools.closeToolbox(target);
|
yield gDevTools.closeToolbox(target);
|
||||||
gBrowser.removeCurrentTab();
|
gBrowser.removeCurrentTab();
|
||||||
});
|
});
|
||||||
@ -49,37 +49,29 @@ function* testSidebar(toolbox) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkResults(Telemetry) {
|
function checkResults() {
|
||||||
let result = Telemetry.prototype.telemetryInfo;
|
// For help generating these tests use generateTelemetryTests("DEVTOOLS_")
|
||||||
|
// here.
|
||||||
for (let [histId, value] of Iterator(result)) {
|
checkTelemetry("DEVTOOLS_ANIMATIONINSPECTOR_OPENED_BOOLEAN", [0,2,0]);
|
||||||
if (histId.startsWith("DEVTOOLS_INSPECTOR_")) {
|
checkTelemetry("DEVTOOLS_ANIMATIONINSPECTOR_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
// Inspector stats are tested in browser_telemetry_toolboxtabs.js so we
|
checkTelemetry("DEVTOOLS_ANIMATIONINSPECTOR_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
// skip them here because we only open the inspector once for this test.
|
checkTelemetry("DEVTOOLS_COMPUTEDVIEW_OPENED_BOOLEAN", [0,2,0]);
|
||||||
continue;
|
checkTelemetry("DEVTOOLS_COMPUTEDVIEW_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
}
|
checkTelemetry("DEVTOOLS_COMPUTEDVIEW_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_LISTTABS_MS", null, "hasentries");
|
||||||
if (histId.endsWith("OPENED_PER_USER_FLAG")) {
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_PROTOCOLDESCRIPTION_MS", null, "hasentries");
|
||||||
ok(value.length === 1 && value[0] === true,
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_RECONFIGURETAB_MS", null, "hasentries");
|
||||||
"Per user value " + histId + " has a single value of true");
|
checkTelemetry("DEVTOOLS_FONTINSPECTOR_OPENED_BOOLEAN", [0,2,0]);
|
||||||
} else if (histId === "DEVTOOLS_TOOLBOX_OPENED_BOOLEAN") {
|
checkTelemetry("DEVTOOLS_FONTINSPECTOR_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
is(value.length, 1, histId + " has only one entry");
|
checkTelemetry("DEVTOOLS_FONTINSPECTOR_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
} else if (histId.endsWith("OPENED_BOOLEAN")) {
|
checkTelemetry("DEVTOOLS_INSPECTOR_OPENED_BOOLEAN", [0,1,0]);
|
||||||
ok(value.length > 1, histId + " has more than one entry");
|
checkTelemetry("DEVTOOLS_INSPECTOR_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_LAYOUTVIEW_OPENED_BOOLEAN", [0,2,0]);
|
||||||
let okay = value.every(function(element) {
|
checkTelemetry("DEVTOOLS_LAYOUTVIEW_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
return element === true;
|
checkTelemetry("DEVTOOLS_LAYOUTVIEW_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
});
|
checkTelemetry("DEVTOOLS_RULEVIEW_OPENED_BOOLEAN", [0,3,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_RULEVIEW_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
ok(okay, "All " + histId + " entries are === true");
|
checkTelemetry("DEVTOOLS_RULEVIEW_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
} else if (histId.endsWith("TIME_ACTIVE_SECONDS")) {
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_BOOLEAN", [0,1,0]);
|
||||||
ok(value.length > 1, histId + " has more than one entry");
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
|
||||||
let okay = value.every(function(element) {
|
|
||||||
return element > 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
ok(okay, "All " + histId + " entries have time > 0");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -10,11 +10,28 @@ const TOOL_DELAY = 200;
|
|||||||
|
|
||||||
add_task(function*() {
|
add_task(function*() {
|
||||||
yield promiseTab(TEST_URI);
|
yield promiseTab(TEST_URI);
|
||||||
let Telemetry = loadTelemetryAndRecordLogs();
|
|
||||||
|
startTelemetry();
|
||||||
|
|
||||||
yield openAndCloseToolbox(3, TOOL_DELAY, "inspector");
|
yield openAndCloseToolbox(3, TOOL_DELAY, "inspector");
|
||||||
checkTelemetryResults(Telemetry);
|
checkResults();
|
||||||
|
|
||||||
stopRecordingTelemetryLogs(Telemetry);
|
|
||||||
gBrowser.removeCurrentTab();
|
gBrowser.removeCurrentTab();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function checkResults() {
|
||||||
|
// For help generating these tests use generateTelemetryTests("DEVTOOLS_")
|
||||||
|
// here.
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_LISTTABS_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_RECONFIGURETAB_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_TABDETACH_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_INSPECTOR_OPENED_BOOLEAN", [0,3,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_INSPECTOR_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_INSPECTOR_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_RULEVIEW_OPENED_BOOLEAN", [0,3,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_RULEVIEW_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_RULEVIEW_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_BOOLEAN", [0,3,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
}
|
||||||
|
@ -14,14 +14,28 @@ add_task(function*() {
|
|||||||
Services.prefs.setBoolPref("devtools.canvasdebugger.enabled", true);
|
Services.prefs.setBoolPref("devtools.canvasdebugger.enabled", true);
|
||||||
|
|
||||||
yield promiseTab(TEST_URI);
|
yield promiseTab(TEST_URI);
|
||||||
let Telemetry = loadTelemetryAndRecordLogs();
|
|
||||||
|
startTelemetry();
|
||||||
|
|
||||||
yield openAndCloseToolbox(2, TOOL_DELAY, "canvasdebugger");
|
yield openAndCloseToolbox(2, TOOL_DELAY, "canvasdebugger");
|
||||||
checkTelemetryResults(Telemetry);
|
checkResults();
|
||||||
|
|
||||||
stopRecordingTelemetryLogs(Telemetry);
|
|
||||||
gBrowser.removeCurrentTab();
|
gBrowser.removeCurrentTab();
|
||||||
|
|
||||||
info("De-activate the canvasdebugger");
|
info("De-activate the canvasdebugger");
|
||||||
Services.prefs.setBoolPref("devtools.canvasdebugger.enabled", originalPref);
|
Services.prefs.setBoolPref("devtools.canvasdebugger.enabled", originalPref);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function checkResults() {
|
||||||
|
// For help generating these tests use generateTelemetryTests("DEVTOOLS_")
|
||||||
|
// here.
|
||||||
|
checkTelemetry("DEVTOOLS_CANVASDEBUGGER_OPENED_BOOLEAN", [0,2,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_CANVASDEBUGGER_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_CANVASDEBUGGER_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_LISTTABS_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_RECONFIGURETAB_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_TABDETACH_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_BOOLEAN", [0,2,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
}
|
||||||
|
@ -10,11 +10,28 @@ const TOOL_DELAY = 200;
|
|||||||
|
|
||||||
add_task(function*() {
|
add_task(function*() {
|
||||||
yield promiseTab(TEST_URI);
|
yield promiseTab(TEST_URI);
|
||||||
let Telemetry = loadTelemetryAndRecordLogs();
|
|
||||||
|
startTelemetry();
|
||||||
|
|
||||||
yield openAndCloseToolbox(2, TOOL_DELAY, "inspector");
|
yield openAndCloseToolbox(2, TOOL_DELAY, "inspector");
|
||||||
checkTelemetryResults(Telemetry);
|
checkResults();
|
||||||
|
|
||||||
stopRecordingTelemetryLogs(Telemetry);
|
|
||||||
gBrowser.removeCurrentTab();
|
gBrowser.removeCurrentTab();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function checkResults() {
|
||||||
|
// For help generating these tests use generateTelemetryTests("DEVTOOLS_")
|
||||||
|
// here.
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_LISTTABS_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_RECONFIGURETAB_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_TABDETACH_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_INSPECTOR_OPENED_BOOLEAN", [0,2,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_INSPECTOR_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_INSPECTOR_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_RULEVIEW_OPENED_BOOLEAN", [0,2,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_RULEVIEW_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_RULEVIEW_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_BOOLEAN", [0,2,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
}
|
||||||
|
@ -10,11 +10,29 @@ const TOOL_DELAY = 200;
|
|||||||
|
|
||||||
add_task(function*() {
|
add_task(function*() {
|
||||||
yield promiseTab(TEST_URI);
|
yield promiseTab(TEST_URI);
|
||||||
let Telemetry = loadTelemetryAndRecordLogs();
|
|
||||||
|
startTelemetry();
|
||||||
|
|
||||||
yield openAndCloseToolbox(2, TOOL_DELAY, "jsdebugger");
|
yield openAndCloseToolbox(2, TOOL_DELAY, "jsdebugger");
|
||||||
checkTelemetryResults(Telemetry);
|
checkResults();
|
||||||
|
|
||||||
stopRecordingTelemetryLogs(Telemetry);
|
|
||||||
gBrowser.removeCurrentTab();
|
gBrowser.removeCurrentTab();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function checkResults() {
|
||||||
|
// For help generating these tests use generateTelemetryTests("DEVTOOLS_")
|
||||||
|
// here.
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_LISTTABS_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_RECONFIGURETAB_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_RECONFIGURETHREAD_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_RESUME_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_SOURCES_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_TABDETACH_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_THREADDETACH_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_JSDEBUGGER_OPENED_BOOLEAN", [0,2,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_JSDEBUGGER_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_JSDEBUGGER_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_BOOLEAN", [0,2,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
}
|
||||||
|
@ -9,11 +9,25 @@ const TOOL_DELAY = 200;
|
|||||||
|
|
||||||
add_task(function*() {
|
add_task(function*() {
|
||||||
yield promiseTab(TEST_URI);
|
yield promiseTab(TEST_URI);
|
||||||
let Telemetry = loadTelemetryAndRecordLogs();
|
|
||||||
|
startTelemetry();
|
||||||
|
|
||||||
yield openAndCloseToolbox(2, TOOL_DELAY, "jsprofiler");
|
yield openAndCloseToolbox(2, TOOL_DELAY, "jsprofiler");
|
||||||
checkTelemetryResults(Telemetry);
|
checkResults();
|
||||||
|
|
||||||
stopRecordingTelemetryLogs(Telemetry);
|
|
||||||
gBrowser.removeCurrentTab();
|
gBrowser.removeCurrentTab();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function checkResults() {
|
||||||
|
// For help generating these tests use generateTelemetryTests("DEVTOOLS_")
|
||||||
|
// here.
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_LISTTABS_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_RECONFIGURETAB_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_TABDETACH_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_JSPROFILER_OPENED_BOOLEAN", [0,2,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_JSPROFILER_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_JSPROFILER_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_BOOLEAN", [0,2,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
}
|
||||||
|
@ -9,12 +9,25 @@ const TOOL_DELAY = 200;
|
|||||||
|
|
||||||
add_task(function*() {
|
add_task(function*() {
|
||||||
yield promiseTab(TEST_URI);
|
yield promiseTab(TEST_URI);
|
||||||
let Telemetry = loadTelemetryAndRecordLogs();
|
|
||||||
|
startTelemetry();
|
||||||
|
|
||||||
yield openAndCloseToolbox(2, TOOL_DELAY, "netmonitor");
|
yield openAndCloseToolbox(2, TOOL_DELAY, "netmonitor");
|
||||||
checkTelemetryResults(Telemetry);
|
checkResults();
|
||||||
|
|
||||||
stopRecordingTelemetryLogs(Telemetry);
|
|
||||||
gBrowser.removeCurrentTab();
|
gBrowser.removeCurrentTab();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function checkResults() {
|
||||||
|
// For help generating these tests use generateTelemetryTests("DEVTOOLS_")
|
||||||
|
// here.
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_LISTTABS_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_RECONFIGURETAB_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_TABDETACH_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_NETMONITOR_OPENED_BOOLEAN", [0,2,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_NETMONITOR_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_NETMONITOR_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_BOOLEAN", [0,2,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
}
|
||||||
|
@ -9,11 +9,25 @@ const TOOL_DELAY = 200;
|
|||||||
|
|
||||||
add_task(function*() {
|
add_task(function*() {
|
||||||
yield promiseTab(TEST_URI);
|
yield promiseTab(TEST_URI);
|
||||||
let Telemetry = loadTelemetryAndRecordLogs();
|
|
||||||
|
startTelemetry();
|
||||||
|
|
||||||
yield openAndCloseToolbox(2, TOOL_DELAY, "options");
|
yield openAndCloseToolbox(2, TOOL_DELAY, "options");
|
||||||
checkTelemetryResults(Telemetry);
|
checkResults();
|
||||||
|
|
||||||
stopRecordingTelemetryLogs(Telemetry);
|
|
||||||
gBrowser.removeCurrentTab();
|
gBrowser.removeCurrentTab();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function checkResults() {
|
||||||
|
// For help generating these tests use generateTelemetryTests("DEVTOOLS_")
|
||||||
|
// here.
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_LISTTABS_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_RECONFIGURETAB_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_TABDETACH_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_OPTIONS_OPENED_BOOLEAN", [0,2,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_OPTIONS_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_OPTIONS_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_BOOLEAN", [0,2,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
}
|
||||||
|
@ -20,14 +20,28 @@ add_task(function*() {
|
|||||||
Services.prefs.setBoolPref("devtools.shadereditor.enabled", true);
|
Services.prefs.setBoolPref("devtools.shadereditor.enabled", true);
|
||||||
|
|
||||||
yield promiseTab(TEST_URI);
|
yield promiseTab(TEST_URI);
|
||||||
let Telemetry = loadTelemetryAndRecordLogs();
|
|
||||||
|
startTelemetry();
|
||||||
|
|
||||||
yield openAndCloseToolbox(2, TOOL_DELAY, "shadereditor");
|
yield openAndCloseToolbox(2, TOOL_DELAY, "shadereditor");
|
||||||
checkTelemetryResults(Telemetry);
|
checkResults();
|
||||||
|
|
||||||
stopRecordingTelemetryLogs(Telemetry);
|
|
||||||
gBrowser.removeCurrentTab();
|
gBrowser.removeCurrentTab();
|
||||||
|
|
||||||
info("De-activate the sharer editor");
|
info("De-activate the sharer editor");
|
||||||
Services.prefs.setBoolPref("devtools.shadereditor.enabled", originalPref);
|
Services.prefs.setBoolPref("devtools.shadereditor.enabled", originalPref);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function checkResults() {
|
||||||
|
// For help generating these tests use generateTelemetryTests("DEVTOOLS_")
|
||||||
|
// here.
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_LISTTABS_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_RECONFIGURETAB_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_TABDETACH_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_SHADEREDITOR_OPENED_BOOLEAN", [0,2,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_SHADEREDITOR_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_SHADEREDITOR_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_BOOLEAN", [0,2,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
}
|
||||||
|
@ -12,14 +12,28 @@ add_task(function*() {
|
|||||||
Services.prefs.setBoolPref("devtools.storage.enabled", true);
|
Services.prefs.setBoolPref("devtools.storage.enabled", true);
|
||||||
|
|
||||||
yield promiseTab(TEST_URI);
|
yield promiseTab(TEST_URI);
|
||||||
let Telemetry = loadTelemetryAndRecordLogs();
|
|
||||||
|
startTelemetry();
|
||||||
|
|
||||||
yield openAndCloseToolbox(2, TOOL_DELAY, "storage");
|
yield openAndCloseToolbox(2, TOOL_DELAY, "storage");
|
||||||
checkTelemetryResults(Telemetry);
|
checkResults();
|
||||||
|
|
||||||
stopRecordingTelemetryLogs(Telemetry);
|
|
||||||
gBrowser.removeCurrentTab();
|
gBrowser.removeCurrentTab();
|
||||||
|
|
||||||
info("De-activating the storage inspector");
|
info("De-activating the storage inspector");
|
||||||
Services.prefs.clearUserPref("devtools.storage.enabled");
|
Services.prefs.clearUserPref("devtools.storage.enabled");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function checkResults() {
|
||||||
|
// For help generating these tests use generateTelemetryTests("DEVTOOLS_")
|
||||||
|
// here.
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_LISTTABS_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_RECONFIGURETAB_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_TABDETACH_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_STORAGE_OPENED_BOOLEAN", [0,2,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_STORAGE_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_STORAGE_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_BOOLEAN", [0,2,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
}
|
||||||
|
@ -9,12 +9,25 @@ const TOOL_DELAY = 200;
|
|||||||
|
|
||||||
add_task(function*() {
|
add_task(function*() {
|
||||||
yield promiseTab(TEST_URI);
|
yield promiseTab(TEST_URI);
|
||||||
let Telemetry = loadTelemetryAndRecordLogs();
|
|
||||||
|
startTelemetry();
|
||||||
|
|
||||||
yield openAndCloseToolbox(2, TOOL_DELAY, "styleeditor");
|
yield openAndCloseToolbox(2, TOOL_DELAY, "styleeditor");
|
||||||
checkTelemetryResults(Telemetry);
|
checkResults();
|
||||||
|
|
||||||
stopRecordingTelemetryLogs(Telemetry);
|
|
||||||
gBrowser.removeCurrentTab();
|
gBrowser.removeCurrentTab();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function checkResults() {
|
||||||
|
// For help generating these tests use generateTelemetryTests("DEVTOOLS_")
|
||||||
|
// here.
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_LISTTABS_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_RECONFIGURETAB_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_TABDETACH_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_STYLEEDITOR_OPENED_BOOLEAN", [0,2,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_STYLEEDITOR_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_STYLEEDITOR_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_BOOLEAN", [0,2,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
}
|
||||||
|
@ -13,14 +13,28 @@ add_task(function*() {
|
|||||||
Services.prefs.setBoolPref("devtools.webaudioeditor.enabled", true);
|
Services.prefs.setBoolPref("devtools.webaudioeditor.enabled", true);
|
||||||
|
|
||||||
yield promiseTab(TEST_URI);
|
yield promiseTab(TEST_URI);
|
||||||
let Telemetry = loadTelemetryAndRecordLogs();
|
|
||||||
|
startTelemetry();
|
||||||
|
|
||||||
yield openAndCloseToolbox(2, TOOL_DELAY, "webaudioeditor");
|
yield openAndCloseToolbox(2, TOOL_DELAY, "webaudioeditor");
|
||||||
checkTelemetryResults(Telemetry);
|
checkResults();
|
||||||
|
|
||||||
stopRecordingTelemetryLogs(Telemetry);
|
|
||||||
gBrowser.removeCurrentTab();
|
gBrowser.removeCurrentTab();
|
||||||
|
|
||||||
info("De-activating the webaudioeditor");
|
info("De-activating the webaudioeditor");
|
||||||
Services.prefs.setBoolPref("devtools.webaudioeditor.enabled", originalPref);
|
Services.prefs.setBoolPref("devtools.webaudioeditor.enabled", originalPref);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function checkResults() {
|
||||||
|
// For help generating these tests use generateTelemetryTests("DEVTOOLS_")
|
||||||
|
// here.
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_LISTTABS_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_RECONFIGURETAB_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_TABDETACH_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_BOOLEAN", [0,2,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_WEBAUDIOEDITOR_OPENED_BOOLEAN", [0,2,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_WEBAUDIOEDITOR_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_WEBAUDIOEDITOR_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
}
|
||||||
|
@ -9,11 +9,25 @@ const TOOL_DELAY = 200;
|
|||||||
|
|
||||||
add_task(function*() {
|
add_task(function*() {
|
||||||
yield promiseTab(TEST_URI);
|
yield promiseTab(TEST_URI);
|
||||||
let Telemetry = loadTelemetryAndRecordLogs();
|
|
||||||
|
startTelemetry();
|
||||||
|
|
||||||
yield openAndCloseToolbox(2, TOOL_DELAY, "webconsole");
|
yield openAndCloseToolbox(2, TOOL_DELAY, "webconsole");
|
||||||
checkTelemetryResults(Telemetry);
|
checkResults();
|
||||||
|
|
||||||
stopRecordingTelemetryLogs(Telemetry);
|
|
||||||
gBrowser.removeCurrentTab();
|
gBrowser.removeCurrentTab();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function checkResults() {
|
||||||
|
// For help generating these tests use generateTelemetryTests("DEVTOOLS_")
|
||||||
|
// here.
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_LISTTABS_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_RECONFIGURETAB_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_TABDETACH_MS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_BOOLEAN", [0,2,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_TOOLBOX_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_WEBCONSOLE_OPENED_BOOLEAN", [0,2,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_WEBCONSOLE_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_WEBCONSOLE_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
|
}
|
||||||
|
@ -6,11 +6,15 @@ let {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
|||||||
let {TargetFactory, require} = devtools;
|
let {TargetFactory, require} = devtools;
|
||||||
let {console} = Cu.import("resource://gre/modules/devtools/Console.jsm", {});
|
let {console} = Cu.import("resource://gre/modules/devtools/Console.jsm", {});
|
||||||
let {gDevTools} = Cu.import("resource:///modules/devtools/gDevTools.jsm", {});
|
let {gDevTools} = Cu.import("resource:///modules/devtools/gDevTools.jsm", {});
|
||||||
|
let {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
|
||||||
const {DOMHelpers} = Cu.import("resource:///modules/devtools/DOMHelpers.jsm", {});
|
const {DOMHelpers} = Cu.import("resource:///modules/devtools/DOMHelpers.jsm", {});
|
||||||
const {Hosts} = require("devtools/framework/toolbox-hosts");
|
const {Hosts} = require("devtools/framework/toolbox-hosts");
|
||||||
|
|
||||||
|
let oldCanRecord = Services.telemetry.canRecord;
|
||||||
|
|
||||||
gDevTools.testing = true;
|
gDevTools.testing = true;
|
||||||
SimpleTest.registerCleanupFunction(() => {
|
registerCleanupFunction(() => {
|
||||||
|
_stopTelemetry();
|
||||||
gDevTools.testing = false;
|
gDevTools.testing = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -150,75 +154,126 @@ let createHost = Task.async(function*(type = "bottom", src = "data:text/html;cha
|
|||||||
return [host, iframe.contentWindow, iframe.contentDocument];
|
return [host, iframe.contentWindow, iframe.contentDocument];
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
function reportError(error) {
|
||||||
* Load the Telemetry utils, then stub Telemetry.prototype.log in order to
|
let stack = " " + error.stack.replace(/\n?.*?@/g, "\n JS frame :: ");
|
||||||
* record everything that's logged in it.
|
|
||||||
* Store all recordings on Telemetry.telemetryInfo.
|
|
||||||
* @return {Telemetry}
|
|
||||||
*/
|
|
||||||
function loadTelemetryAndRecordLogs() {
|
|
||||||
info("Mock the Telemetry log function to record logged information");
|
|
||||||
|
|
||||||
let Telemetry = require("devtools/shared/telemetry");
|
ok(false, "ERROR: " + error + " at " + error.fileName + ":" +
|
||||||
Telemetry.prototype.telemetryInfo = {};
|
error.lineNumber + "\n\nStack trace:" + stack);
|
||||||
Telemetry.prototype._oldlog = Telemetry.prototype.log;
|
|
||||||
Telemetry.prototype.log = function(histogramId, value) {
|
|
||||||
if (!this.telemetryInfo) {
|
|
||||||
// Can be removed when Bug 992911 lands (see Bug 1011652 Comment 10)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (histogramId) {
|
|
||||||
if (!this.telemetryInfo[histogramId]) {
|
|
||||||
this.telemetryInfo[histogramId] = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
this.telemetryInfo[histogramId].push(value);
|
if (finishUp) {
|
||||||
}
|
finishUp();
|
||||||
};
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return Telemetry;
|
function startTelemetry() {
|
||||||
|
Services.telemetry.canRecord = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stop recording the Telemetry logs and put back the utils as it was before.
|
* This method is automatically called on teardown.
|
||||||
*/
|
*/
|
||||||
function stopRecordingTelemetryLogs(Telemetry) {
|
function _stopTelemetry() {
|
||||||
Telemetry.prototype.log = Telemetry.prototype._oldlog;
|
let Telemetry = devtools.require("devtools/shared/telemetry");
|
||||||
delete Telemetry.prototype._oldlog;
|
let telemetry = new Telemetry();
|
||||||
delete Telemetry.prototype.telemetryInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
telemetry.clearToolsOpenedPref();
|
||||||
* Check the correctness of the data recorded in Telemetry after
|
|
||||||
* loadTelemetryAndRecordLogs was called.
|
|
||||||
*/
|
|
||||||
function checkTelemetryResults(Telemetry) {
|
|
||||||
let result = Telemetry.prototype.telemetryInfo;
|
|
||||||
|
|
||||||
for (let [histId, value] of Iterator(result)) {
|
Services.telemetry.canRecord = oldCanRecord;
|
||||||
if (histId.endsWith("OPENED_PER_USER_FLAG")) {
|
|
||||||
ok(value.length === 1 && value[0] === true,
|
|
||||||
"Per user value " + histId + " has a single value of true");
|
|
||||||
} else if (histId.endsWith("OPENED_BOOLEAN")) {
|
|
||||||
ok(value.length > 1, histId + " has more than one entry");
|
|
||||||
|
|
||||||
let okay = value.every(function(element) {
|
// Clean up telemetry histogram changes
|
||||||
return element === true;
|
for (let histId in Services.telemetry.histogramSnapshots) {
|
||||||
});
|
try {
|
||||||
|
let histogram = Services.telemetry.getHistogramById(histId);
|
||||||
ok(okay, "All " + histId + " entries are === true");
|
histogram.clear();
|
||||||
} else if (histId.endsWith("TIME_ACTIVE_SECONDS")) {
|
} catch(e) {
|
||||||
ok(value.length > 1, histId + " has more than one entry");
|
// Histograms is not listed in histograms.json, do nothing.
|
||||||
|
|
||||||
let okay = value.every(function(element) {
|
|
||||||
return element > 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
ok(okay, "All " + histId + " entries have time > 0");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check the value of a given telemetry histogram.
|
||||||
|
*
|
||||||
|
* @param {String} histId
|
||||||
|
* Histogram id
|
||||||
|
* @param {Array|Number} expected
|
||||||
|
* Expected value
|
||||||
|
* @param {String} checkType
|
||||||
|
* "array" (default) - Check that an array matches the histogram data.
|
||||||
|
* "hasentries" - For non-enumerated linear and exponential
|
||||||
|
* histograms. This checks for at least one entry.
|
||||||
|
*/
|
||||||
|
function checkTelemetry(histId, expected, checkType="array") {
|
||||||
|
let actual = Services.telemetry.getHistogramById(histId).snapshot().counts;
|
||||||
|
|
||||||
|
switch (checkType) {
|
||||||
|
case "array":
|
||||||
|
is(JSON.stringify(actual), JSON.stringify(expected), histId + " correct.");
|
||||||
|
break;
|
||||||
|
case "hasentries":
|
||||||
|
let hasEntry = actual.some(num => num > 0);
|
||||||
|
ok(hasEntry, histId + " has at least one entry.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate telemetry tests. You should call generateTelemetryTests("DEVTOOLS_")
|
||||||
|
* from your result checking code in telemetry tests. It logs checkTelemetry
|
||||||
|
* calls for all changed telemetry values.
|
||||||
|
*
|
||||||
|
* @param {String} prefix
|
||||||
|
* Optionally limits results to histogram ids starting with prefix.
|
||||||
|
*/
|
||||||
|
function generateTelemetryTests(prefix="") {
|
||||||
|
dump("=".repeat(80) + "\n");
|
||||||
|
for (let histId in Services.telemetry.histogramSnapshots) {
|
||||||
|
if (!histId.startsWith(prefix)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
let snapshot = Services.telemetry.histogramSnapshots[histId];
|
||||||
|
let actual = snapshot.counts;
|
||||||
|
|
||||||
|
switch (snapshot.histogram_type) {
|
||||||
|
case Services.telemetry.HISTOGRAM_EXPONENTIAL:
|
||||||
|
case Services.telemetry.HISTOGRAM_LINEAR:
|
||||||
|
let total = 0;
|
||||||
|
for (let val of actual) {
|
||||||
|
total += val;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (histId.endsWith("_ENUMERATED")) {
|
||||||
|
if (total > 0) {
|
||||||
|
dump("checkTelemetry(\"" + histId + "\", " + JSON.stringify(actual) + ");\n");
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
dump("checkTelemetry(\"" + histId + "\", null, \"hasentries\");\n");
|
||||||
|
break;
|
||||||
|
case Services.telemetry.HISTOGRAM_BOOLEAN:
|
||||||
|
actual = JSON.stringify(actual);
|
||||||
|
|
||||||
|
if (actual !== "[0,0,0]") {
|
||||||
|
dump("checkTelemetry(\"" + histId + "\", " + actual + ");\n");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Services.telemetry.HISTOGRAM_FLAG:
|
||||||
|
actual = JSON.stringify(actual);
|
||||||
|
|
||||||
|
if (actual !== "[1,0,0]") {
|
||||||
|
dump("checkTelemetry(\"" + histId + "\", " + actual + ");\n");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Services.telemetry.HISTOGRAM_COUNT:
|
||||||
|
dump("checkTelemetry(\"" + histId + "\", " + actual + ");\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dump("=".repeat(80) + "\n");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open and close the toolbox in the current browser tab, several times, waiting
|
* Open and close the toolbox in the current browser tab, several times, waiting
|
||||||
* some amount of time in between.
|
* some amount of time in between.
|
||||||
@ -230,7 +285,7 @@ function* openAndCloseToolbox(nbOfTimes, usageTime, toolId) {
|
|||||||
for (let i = 0; i < nbOfTimes; i ++) {
|
for (let i = 0; i < nbOfTimes; i ++) {
|
||||||
info("Opening toolbox " + (i + 1));
|
info("Opening toolbox " + (i + 1));
|
||||||
let target = TargetFactory.forTab(gBrowser.selectedTab);
|
let target = TargetFactory.forTab(gBrowser.selectedTab);
|
||||||
yield gDevTools.showToolbox(target, toolId)
|
yield gDevTools.showToolbox(target, toolId);
|
||||||
|
|
||||||
// We use a timeout to check the toolbox's active time
|
// We use a timeout to check the toolbox's active time
|
||||||
yield new Promise(resolve => setTimeout(resolve, usageTime));
|
yield new Promise(resolve => setTimeout(resolve, usageTime));
|
||||||
|
@ -21,8 +21,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "ViewHelpers",
|
|||||||
XPCOMUtils.defineLazyModuleGetter(this, "VariablesView",
|
XPCOMUtils.defineLazyModuleGetter(this, "VariablesView",
|
||||||
"resource:///modules/devtools/VariablesView.jsm");
|
"resource:///modules/devtools/VariablesView.jsm");
|
||||||
|
|
||||||
let Telemetry = require("devtools/shared/telemetry");
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Localization convenience methods.
|
* Localization convenience methods.
|
||||||
*/
|
*/
|
||||||
@ -87,9 +85,6 @@ this.StorageUI = function StorageUI(front, target, panelWin) {
|
|||||||
|
|
||||||
this.handleKeypress = this.handleKeypress.bind(this);
|
this.handleKeypress = this.handleKeypress.bind(this);
|
||||||
this._panelDoc.addEventListener("keypress", this.handleKeypress);
|
this._panelDoc.addEventListener("keypress", this.handleKeypress);
|
||||||
|
|
||||||
this._telemetry = new Telemetry();
|
|
||||||
this._telemetry.toolOpened("storage");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.StorageUI = StorageUI;
|
exports.StorageUI = StorageUI;
|
||||||
@ -102,7 +97,6 @@ StorageUI.prototype = {
|
|||||||
destroy: function() {
|
destroy: function() {
|
||||||
this.front.off("stores-update", this.onUpdate);
|
this.front.off("stores-update", this.onUpdate);
|
||||||
this._panelDoc.removeEventListener("keypress", this.handleKeypress);
|
this._panelDoc.removeEventListener("keypress", this.handleKeypress);
|
||||||
this._telemetry.toolClosed("storage");
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -42,7 +42,6 @@ let WebAudioEditorController = {
|
|||||||
* Listen for events emitted by the current tab target.
|
* Listen for events emitted by the current tab target.
|
||||||
*/
|
*/
|
||||||
initialize: Task.async(function* () {
|
initialize: Task.async(function* () {
|
||||||
telemetry.toolOpened("webaudioeditor");
|
|
||||||
this._onTabNavigated = this._onTabNavigated.bind(this);
|
this._onTabNavigated = this._onTabNavigated.bind(this);
|
||||||
this._onThemeChange = this._onThemeChange.bind(this);
|
this._onThemeChange = this._onThemeChange.bind(this);
|
||||||
|
|
||||||
@ -69,7 +68,6 @@ let WebAudioEditorController = {
|
|||||||
* Remove events emitted by the current tab target.
|
* Remove events emitted by the current tab target.
|
||||||
*/
|
*/
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
telemetry.toolClosed("webaudioeditor");
|
|
||||||
gTarget.off("will-navigate", this._onTabNavigated);
|
gTarget.off("will-navigate", this._onTabNavigated);
|
||||||
gTarget.off("navigate", this._onTabNavigated);
|
gTarget.off("navigate", this._onTabNavigated);
|
||||||
gFront.off("start-context", this._onStartContext);
|
gFront.off("start-context", this._onStartContext);
|
||||||
|
@ -19,10 +19,9 @@ let { EventTarget } = require("sdk/event/target");
|
|||||||
const { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
|
const { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
|
||||||
const { Class } = require("sdk/core/heritage");
|
const { Class } = require("sdk/core/heritage");
|
||||||
const EventEmitter = require("devtools/toolkit/event-emitter");
|
const EventEmitter = require("devtools/toolkit/event-emitter");
|
||||||
const STRINGS_URI = "chrome://browser/locale/devtools/webaudioeditor.properties"
|
const STRINGS_URI = "chrome://browser/locale/devtools/webaudioeditor.properties";
|
||||||
const L10N = new ViewHelpers.L10N(STRINGS_URI);
|
const L10N = new ViewHelpers.L10N(STRINGS_URI);
|
||||||
const Telemetry = require("devtools/shared/telemetry");
|
|
||||||
const telemetry = new Telemetry();
|
|
||||||
devtools.lazyImporter(this, "LineGraphWidget",
|
devtools.lazyImporter(this, "LineGraphWidget",
|
||||||
"resource:///modules/devtools/Graphs.jsm");
|
"resource:///modules/devtools/Graphs.jsm");
|
||||||
|
|
||||||
|
@ -14,6 +14,8 @@ const {require} = devtools;
|
|||||||
const promise = require("promise");
|
const promise = require("promise");
|
||||||
const {AppProjects} = require("devtools/app-manager/app-projects");
|
const {AppProjects} = require("devtools/app-manager/app-projects");
|
||||||
|
|
||||||
|
let oldCanRecord = Services.telemetry.canRecord;
|
||||||
|
|
||||||
let TEST_BASE;
|
let TEST_BASE;
|
||||||
if (window.location === "chrome://browser/content/browser.xul") {
|
if (window.location === "chrome://browser/content/browser.xul") {
|
||||||
TEST_BASE = "chrome://mochitests/content/browser/browser/devtools/webide/test/";
|
TEST_BASE = "chrome://mochitests/content/browser/browser/devtools/webide/test/";
|
||||||
@ -32,6 +34,8 @@ Services.prefs.setCharPref("devtools.webide.templatesURL", TEST_BASE + "template
|
|||||||
|
|
||||||
|
|
||||||
SimpleTest.registerCleanupFunction(() => {
|
SimpleTest.registerCleanupFunction(() => {
|
||||||
|
_stopTelemetry();
|
||||||
|
|
||||||
Services.prefs.clearUserPref("devtools.webide.enabled");
|
Services.prefs.clearUserPref("devtools.webide.enabled");
|
||||||
Services.prefs.clearUserPref("devtools.webide.enableLocalRuntime");
|
Services.prefs.clearUserPref("devtools.webide.enableLocalRuntime");
|
||||||
Services.prefs.clearUserPref("devtools.webide.autoinstallADBHelper");
|
Services.prefs.clearUserPref("devtools.webide.autoinstallADBHelper");
|
||||||
@ -207,3 +211,112 @@ function handleError(aError) {
|
|||||||
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
|
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function startTelemetry() {
|
||||||
|
Services.telemetry.canRecord = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is automatically called on teardown.
|
||||||
|
*/
|
||||||
|
function _stopTelemetry() {
|
||||||
|
let Telemetry = devtools.require("devtools/shared/telemetry");
|
||||||
|
let telemetry = new Telemetry();
|
||||||
|
|
||||||
|
telemetry.clearToolsOpenedPref();
|
||||||
|
|
||||||
|
Services.telemetry.canRecord = oldCanRecord;
|
||||||
|
|
||||||
|
// Clean up telemetry histogram changes
|
||||||
|
for (let histId in Services.telemetry.histogramSnapshots) {
|
||||||
|
try {
|
||||||
|
let histogram = Services.telemetry.getHistogramById(histId);
|
||||||
|
histogram.clear();
|
||||||
|
} catch(e) {
|
||||||
|
// Histograms is not listed in histograms.json, do nothing.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check the value of a given telemetry histogram.
|
||||||
|
*
|
||||||
|
* @param {String} histId
|
||||||
|
* Histogram id
|
||||||
|
* @param {Array|Number} expected
|
||||||
|
* Expected value
|
||||||
|
* @param {String} checkType
|
||||||
|
* "array" (default) - Check that an array matches the histogram data.
|
||||||
|
* "hasentries" - For non-enumerated linear and exponential
|
||||||
|
* histograms. This checks for at least one entry.
|
||||||
|
*/
|
||||||
|
function checkTelemetry(histId, expected, checkType="array") {
|
||||||
|
let actual = Services.telemetry.getHistogramById(histId).snapshot().counts;
|
||||||
|
|
||||||
|
switch (checkType) {
|
||||||
|
case "array":
|
||||||
|
is(JSON.stringify(actual), JSON.stringify(expected), histId + " correct.");
|
||||||
|
break;
|
||||||
|
case "hasentries":
|
||||||
|
let hasEntry = actual.some(num => num > 0);
|
||||||
|
ok(hasEntry, histId + " has at least one entry.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate telemetry tests. You should call generateTelemetryTests("DEVTOOLS_")
|
||||||
|
* from your result checking code in telemetry tests. It logs checkTelemetry
|
||||||
|
* calls for all changed telemetry values.
|
||||||
|
*
|
||||||
|
* @param {String} prefix
|
||||||
|
* Optionally limits results to histogram ids starting with prefix.
|
||||||
|
*/
|
||||||
|
function generateTelemetryTests(prefix="") {
|
||||||
|
dump("=".repeat(80) + "\n");
|
||||||
|
for (let histId in Services.telemetry.histogramSnapshots) {
|
||||||
|
if (!histId.startsWith(prefix)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
let snapshot = Services.telemetry.histogramSnapshots[histId];
|
||||||
|
let actual = snapshot.counts;
|
||||||
|
|
||||||
|
switch (snapshot.histogram_type) {
|
||||||
|
case Services.telemetry.HISTOGRAM_EXPONENTIAL:
|
||||||
|
case Services.telemetry.HISTOGRAM_LINEAR:
|
||||||
|
let total = 0;
|
||||||
|
for (let val of actual) {
|
||||||
|
total += val;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (histId.endsWith("_ENUMERATED")) {
|
||||||
|
if (total > 0) {
|
||||||
|
dump("checkTelemetry(\"" + histId + "\", " + JSON.stringify(actual) + ");\n");
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
dump("checkTelemetry(\"" + histId + "\", null, \"hasentries\");\n");
|
||||||
|
break;
|
||||||
|
case Services.telemetry.HISTOGRAM_BOOLEAN:
|
||||||
|
actual = JSON.stringify(actual);
|
||||||
|
|
||||||
|
if (actual !== "[0,0,0]") {
|
||||||
|
dump("checkTelemetry(\"" + histId + "\", " + actual + ");\n");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Services.telemetry.HISTOGRAM_FLAG:
|
||||||
|
actual = JSON.stringify(actual);
|
||||||
|
|
||||||
|
if (actual !== "[1,0,0]") {
|
||||||
|
dump("checkTelemetry(\"" + histId + "\", " + actual + ");\n");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Services.telemetry.HISTOGRAM_COUNT:
|
||||||
|
dump("checkTelemetry(\"" + histId + "\", " + actual + ");\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dump("=".repeat(80) + "\n");
|
||||||
|
}
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
<body>
|
<body>
|
||||||
|
|
||||||
<script type="application/javascript;version=1.8">
|
<script type="application/javascript;version=1.8">
|
||||||
const Telemetry = require("devtools/shared/telemetry");
|
|
||||||
const { _DeprecatedUSBRuntime, _WiFiRuntime, _SimulatorRuntime,
|
const { _DeprecatedUSBRuntime, _WiFiRuntime, _SimulatorRuntime,
|
||||||
_gRemoteRuntime, _gLocalRuntime, RuntimeTypes }
|
_gRemoteRuntime, _gLocalRuntime, RuntimeTypes }
|
||||||
= require("devtools/webide/runtimes");
|
= require("devtools/webide/runtimes");
|
||||||
@ -24,25 +23,6 @@
|
|||||||
// been opened we make use of setTimeout() to create tool active times.
|
// been opened we make use of setTimeout() to create tool active times.
|
||||||
const TOOL_DELAY = 200;
|
const TOOL_DELAY = 200;
|
||||||
|
|
||||||
function patchTelemetry() {
|
|
||||||
Telemetry.prototype.telemetryInfo = {};
|
|
||||||
Telemetry.prototype._oldlog = Telemetry.prototype.log;
|
|
||||||
Telemetry.prototype.log = function(histogramId, value) {
|
|
||||||
if (histogramId) {
|
|
||||||
if (!this.telemetryInfo[histogramId]) {
|
|
||||||
this.telemetryInfo[histogramId] = [];
|
|
||||||
}
|
|
||||||
this.telemetryInfo[histogramId].push(value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function resetTelemetry() {
|
|
||||||
Telemetry.prototype.log = Telemetry.prototype._oldlog;
|
|
||||||
delete Telemetry.prototype._oldlog;
|
|
||||||
delete Telemetry.prototype.telemetryInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
function cycleWebIDE() {
|
function cycleWebIDE() {
|
||||||
return Task.spawn(function*() {
|
return Task.spawn(function*() {
|
||||||
let win = yield openWebIDE();
|
let win = yield openWebIDE();
|
||||||
@ -149,58 +129,22 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function checkResults() {
|
function checkResults() {
|
||||||
let result = Telemetry.prototype.telemetryInfo;
|
// For help generating these tests use generateTelemetryTests("DEVTOOLS_")
|
||||||
for (let [histId, value] of Iterator(result)) {
|
// here.
|
||||||
if (histId.endsWith("OPENED_PER_USER_FLAG")) {
|
checkTelemetry("DEVTOOLS_DEBUGGER_RDP_LOCAL_LISTTABS_MS", null, "hasentries");
|
||||||
ok(value.length === 1 && !!value[0],
|
checkTelemetry("DEVTOOLS_WEBIDE_CONNECTION_DEBUG_USED", [6,0,0]);
|
||||||
"Per user value " + histId + " has a single value of true");
|
checkTelemetry("DEVTOOLS_WEBIDE_CONNECTION_PLAY_USED", [6,0,0]);
|
||||||
} else if (histId.endsWith("OPENED_BOOLEAN")) {
|
checkTelemetry("DEVTOOLS_WEBIDE_CONNECTION_RESULT", [0,6,0]);
|
||||||
ok(value.length > 1, histId + " has more than one entry");
|
checkTelemetry("DEVTOOLS_WEBIDE_CONNECTION_TIME_SECONDS", null, "hasentries");
|
||||||
|
checkTelemetry("DEVTOOLS_WEBIDE_LOCAL_CONNECTION_RESULT", [0,1,0]);
|
||||||
let okay = value.every(function(element) {
|
checkTelemetry("DEVTOOLS_WEBIDE_OPENED_BOOLEAN", [0,2,0]);
|
||||||
return !!element;
|
checkTelemetry("DEVTOOLS_WEBIDE_OPENED_PER_USER_FLAG", [0,1,0]);
|
||||||
});
|
checkTelemetry("DEVTOOLS_WEBIDE_OTHER_CONNECTION_RESULT", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_WEBIDE_REMOTE_CONNECTION_RESULT", [0,1,0]);
|
||||||
ok(okay, "All " + histId + " entries are true");
|
checkTelemetry("DEVTOOLS_WEBIDE_SIMULATOR_CONNECTION_RESULT", [0,1,0]);
|
||||||
} else if (histId.endsWith("TIME_ACTIVE_SECONDS")) {
|
checkTelemetry("DEVTOOLS_WEBIDE_TIME_ACTIVE_SECONDS", null, "hasentries");
|
||||||
ok(value.length > 1, histId + " has more than one entry");
|
checkTelemetry("DEVTOOLS_WEBIDE_USB_CONNECTION_RESULT", [0,1,0]);
|
||||||
|
checkTelemetry("DEVTOOLS_WEBIDE_WIFI_CONNECTION_RESULT", [0,1,0]);
|
||||||
let okay = value.every(function(element) {
|
|
||||||
return element > 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
ok(okay, "All " + histId + " entries have time > 0");
|
|
||||||
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTION_RESULT") {
|
|
||||||
ok(value.length === 6, histId + " has 6 connection results");
|
|
||||||
|
|
||||||
let okay = value.every(function(element) {
|
|
||||||
return !!element;
|
|
||||||
});
|
|
||||||
|
|
||||||
ok(okay, "All " + histId + " connections succeeded");
|
|
||||||
} else if (histId.endsWith("CONNECTION_RESULT")) {
|
|
||||||
ok(value.length === 1 && !!value[0],
|
|
||||||
histId + " has 1 successful connection");
|
|
||||||
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTION_TIME_SECONDS") {
|
|
||||||
ok(value.length === 6, histId + " has 6 connection results");
|
|
||||||
|
|
||||||
let okay = value.every(function(element) {
|
|
||||||
return element > 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
ok(okay, "All " + histId + " connections have time > 0");
|
|
||||||
} else if (histId.endsWith("USED")) {
|
|
||||||
ok(value.length === 6, histId + " has 6 connection actions");
|
|
||||||
|
|
||||||
let okay = value.every(function(element) {
|
|
||||||
return !element;
|
|
||||||
});
|
|
||||||
|
|
||||||
ok(okay, "All " + histId + " actions were skipped");
|
|
||||||
} else {
|
|
||||||
ok(false, "Unexpected " + histId + " was logged");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
@ -215,7 +159,6 @@
|
|||||||
}
|
}
|
||||||
DebuggerServer.destroy();
|
DebuggerServer.destroy();
|
||||||
yield removeAllProjects();
|
yield removeAllProjects();
|
||||||
resetTelemetry();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -227,7 +170,7 @@
|
|||||||
DebuggerServer.addBrowserActors();
|
DebuggerServer.addBrowserActors();
|
||||||
}
|
}
|
||||||
|
|
||||||
patchTelemetry();
|
startTelemetry();
|
||||||
|
|
||||||
// Cycle once, so we can test for multiple opens
|
// Cycle once, so we can test for multiple opens
|
||||||
yield cycleWebIDE();
|
yield cycleWebIDE();
|
||||||
|
Loading…
Reference in New Issue
Block a user