mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 436e5d00f904 (bug 916804) for mochitest-other failures.
This commit is contained in:
parent
baf8a6b79b
commit
cd25cdc207
@ -26,11 +26,8 @@ Bug 901519 - [app manager] data store for connections
|
||||
<script type="application/javascript;version=1.8">
|
||||
const Cu = Components.utils;
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
DebuggerServer.init(function () { return true; });
|
||||
DebuggerServer.addBrowserActors();
|
||||
}
|
||||
DebuggerServer.init(function () { return true; });
|
||||
DebuggerServer.addBrowserActors();
|
||||
|
||||
window.onload = function() {
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
@ -20,11 +20,8 @@ Bug 901520 - [app manager] data store for device
|
||||
<script type="application/javascript;version=1.8">
|
||||
const Cu = Components.utils;
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
DebuggerServer.init(function () { return true; });
|
||||
DebuggerServer.addBrowserActors();
|
||||
}
|
||||
DebuggerServer.init(function () { return true; });
|
||||
DebuggerServer.addBrowserActors();
|
||||
|
||||
function compare(o1, o2, msg) {
|
||||
is(JSON.stringify(o1), JSON.stringify(o2), msg);
|
||||
|
@ -20,11 +20,8 @@ Bug 912646 - Closing app toolbox causes phone to disconnect
|
||||
const Cu = Components.utils;
|
||||
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
DebuggerServer.init(function () { return true; });
|
||||
DebuggerServer.addBrowserActors();
|
||||
}
|
||||
DebuggerServer.init(function () { return true; });
|
||||
DebuggerServer.addBrowserActors();
|
||||
|
||||
window.onload = function() {
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
@ -36,7 +36,7 @@
|
||||
* about:telemetry.
|
||||
*
|
||||
* You can view telemetry stats for large groups of Firefox users at
|
||||
* telemetry.mozilla.org.
|
||||
* metrics.mozilla.com.
|
||||
*/
|
||||
|
||||
const TOOLS_OPENED_PREF = "devtools.telemetry.tools.opened.version";
|
||||
@ -170,11 +170,6 @@ Telemetry.prototype = {
|
||||
userHistogram: "DEVTOOLS_DEVELOPERTOOLBAR_OPENED_PER_USER_FLAG",
|
||||
timerHistogram: "DEVTOOLS_DEVELOPERTOOLBAR_TIME_ACTIVE_SECONDS"
|
||||
},
|
||||
webide: {
|
||||
histogram: "DEVTOOLS_WEBIDE_OPENED_BOOLEAN",
|
||||
userHistogram: "DEVTOOLS_WEBIDE_OPENED_PER_USER_FLAG",
|
||||
timerHistogram: "DEVTOOLS_WEBIDE_TIME_ACTIVE_SECONDS"
|
||||
},
|
||||
custom: {
|
||||
histogram: "DEVTOOLS_CUSTOM_OPENED_BOOLEAN",
|
||||
userHistogram: "DEVTOOLS_CUSTOM_OPENED_PER_USER_FLAG",
|
||||
@ -199,7 +194,7 @@ Telemetry.prototype = {
|
||||
this.logOncePerBrowserVersion(charts.userHistogram, true);
|
||||
}
|
||||
if (charts.timerHistogram) {
|
||||
this.startTimer(charts.timerHistogram);
|
||||
this._timers.set(charts.timerHistogram, new Date());
|
||||
}
|
||||
},
|
||||
|
||||
@ -210,31 +205,12 @@ Telemetry.prototype = {
|
||||
return;
|
||||
}
|
||||
|
||||
this.stopTimer(charts.timerHistogram);
|
||||
},
|
||||
let startTime = this._timers.get(charts.timerHistogram);
|
||||
|
||||
/**
|
||||
* Record the start time for a timing-based histogram entry.
|
||||
*
|
||||
* @param String histogramId
|
||||
* Histogram in which the data is to be stored.
|
||||
*/
|
||||
startTimer: function(histogramId) {
|
||||
this._timers.set(histogramId, new Date());
|
||||
},
|
||||
|
||||
/**
|
||||
* Stop the timer and log elasped time for a timing-based histogram entry.
|
||||
*
|
||||
* @param String histogramId
|
||||
* Histogram in which the data is to be stored.
|
||||
*/
|
||||
stopTimer: function(histogramId) {
|
||||
let startTime = this._timers.get(histogramId);
|
||||
if (startTime) {
|
||||
let time = (new Date() - startTime) / 1000;
|
||||
this.log(histogramId, time);
|
||||
this._timers.delete(histogramId);
|
||||
this.log(charts.timerHistogram, time);
|
||||
this._timers.delete(charts.timerHistogram);
|
||||
}
|
||||
},
|
||||
|
||||
@ -282,8 +258,11 @@ Telemetry.prototype = {
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
for (let histogramId of this._timers.keys()) {
|
||||
this.stopTimer(histogramId);
|
||||
for (let [histogram, time] of this._timers) {
|
||||
time = (new Date() - time) / 1000;
|
||||
|
||||
this.log(histogram, time);
|
||||
this._timers.delete(histogram);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -89,7 +89,7 @@ function CheckLockState() {
|
||||
// ADB check
|
||||
if (AppManager.selectedRuntime instanceof USBRuntime) {
|
||||
let device = Devices.getByName(AppManager.selectedRuntime.id);
|
||||
if (device && device.summonRoot) {
|
||||
if (device.summonRoot) {
|
||||
device.isRoot().then(isRoot => {
|
||||
if (isRoot) {
|
||||
adbCheckResult.textContent = sYes;
|
||||
|
@ -21,7 +21,6 @@ const ProjectEditor = require("projecteditor/projecteditor");
|
||||
const {Devices} = Cu.import("resource://gre/modules/devtools/Devices.jsm");
|
||||
const {GetAvailableAddons} = require("devtools/webide/addons");
|
||||
const {GetTemplatesJSON, GetAddonsJSON} = require("devtools/webide/remote-resources");
|
||||
const Telemetry = require("devtools/shared/telemetry");
|
||||
|
||||
const Strings = Services.strings.createBundle("chrome://browser/locale/devtools/webide.properties");
|
||||
|
||||
@ -48,9 +47,6 @@ window.addEventListener("unload", function onUnload() {
|
||||
|
||||
let UI = {
|
||||
init: function() {
|
||||
this._telemetry = new Telemetry();
|
||||
this._telemetry.toolOpened("webide");
|
||||
|
||||
AppManager.init();
|
||||
|
||||
this.onMessage = this.onMessage.bind(this);
|
||||
@ -102,8 +98,6 @@ let UI = {
|
||||
AppManager.off("app-manager-update", this.appManagerUpdate);
|
||||
AppManager.uninit();
|
||||
window.removeEventListener("message", this.onMessage);
|
||||
this.updateConnectionTelemetry();
|
||||
this._telemetry.toolClosed("webide");
|
||||
},
|
||||
|
||||
onfocus: function() {
|
||||
@ -127,7 +121,6 @@ let UI = {
|
||||
case "connection":
|
||||
this.updateRuntimeButton();
|
||||
this.updateCommands();
|
||||
this.updateConnectionTelemetry();
|
||||
break;
|
||||
case "project":
|
||||
this.updateTitle();
|
||||
@ -225,13 +218,12 @@ let UI = {
|
||||
},
|
||||
|
||||
busyWithProgressUntil: function(promise, operationDescription) {
|
||||
let busy = this.busyUntil(promise, operationDescription);
|
||||
this.busyUntil(promise, operationDescription);
|
||||
let win = document.querySelector("window");
|
||||
let progress = document.querySelector("#action-busy-determined");
|
||||
progress.mode = "undetermined";
|
||||
win.classList.add("busy-determined");
|
||||
win.classList.remove("busy-undetermined");
|
||||
return busy;
|
||||
},
|
||||
|
||||
busyUntil: function(promise, operationDescription) {
|
||||
@ -341,7 +333,6 @@ let UI = {
|
||||
connectToRuntime: function(runtime) {
|
||||
let name = runtime.getName();
|
||||
let promise = AppManager.connectToRuntime(runtime);
|
||||
promise.then(() => this.initConnectionTelemetry());
|
||||
return this.busyUntil(promise, "connecting to runtime");
|
||||
},
|
||||
|
||||
@ -355,47 +346,6 @@ let UI = {
|
||||
}
|
||||
},
|
||||
|
||||
_actionsToLog: new Set(),
|
||||
|
||||
/**
|
||||
* For each new connection, track whether play and debug were ever used. Only
|
||||
* one value is collected for each button, even if they are used multiple
|
||||
* times during a connection.
|
||||
*/
|
||||
initConnectionTelemetry: function() {
|
||||
this._actionsToLog.add("play");
|
||||
this._actionsToLog.add("debug");
|
||||
},
|
||||
|
||||
/**
|
||||
* Action occurred. Log that it happened, and remove it from the loggable
|
||||
* set.
|
||||
*/
|
||||
onAction: function(action) {
|
||||
if (!this._actionsToLog.has(action)) {
|
||||
return;
|
||||
}
|
||||
this.logActionState(action, true);
|
||||
this._actionsToLog.delete(action);
|
||||
},
|
||||
|
||||
/**
|
||||
* Connection status changed or we are shutting down. Record any loggable
|
||||
* actions as having not occurred.
|
||||
*/
|
||||
updateConnectionTelemetry: function() {
|
||||
for (let action of this._actionsToLog.values()) {
|
||||
this.logActionState(action, false);
|
||||
}
|
||||
this._actionsToLog.clear();
|
||||
},
|
||||
|
||||
logActionState: function(action, state) {
|
||||
let histogramId = "DEVTOOLS_WEBIDE_CONNECTION_" +
|
||||
action.toUpperCase() + "_USED";
|
||||
this._telemetry.log(histogramId, state);
|
||||
},
|
||||
|
||||
/********** PROJECTS **********/
|
||||
|
||||
// Panel & button
|
||||
@ -710,7 +660,8 @@ let UI = {
|
||||
splitter.setAttribute("hidden", "true");
|
||||
document.querySelector("#action-button-debug").removeAttribute("active");
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
let Cmds = {
|
||||
quit: function() {
|
||||
@ -958,25 +909,15 @@ let Cmds = {
|
||||
},
|
||||
|
||||
play: function() {
|
||||
let busy;
|
||||
switch(AppManager.selectedProject.type) {
|
||||
case "packaged":
|
||||
busy = UI.busyWithProgressUntil(AppManager.installAndRunProject(),
|
||||
"installing and running app");
|
||||
break;
|
||||
return UI.busyWithProgressUntil(AppManager.installAndRunProject(), "installing and running app");
|
||||
case "hosted":
|
||||
busy = UI.busyUntil(AppManager.installAndRunProject(),
|
||||
"installing and running app");
|
||||
break;
|
||||
return UI.busyUntil(AppManager.installAndRunProject(), "installing and running app");
|
||||
case "runtimeApp":
|
||||
busy = UI.busyUntil(AppManager.runRuntimeApp(), "running app");
|
||||
break;
|
||||
return UI.busyUntil(AppManager.runRuntimeApp(), "running app");
|
||||
}
|
||||
if (!busy) {
|
||||
return promise.reject();
|
||||
}
|
||||
UI.onAction("play");
|
||||
return busy;
|
||||
return promise.reject();
|
||||
},
|
||||
|
||||
stop: function() {
|
||||
@ -984,7 +925,6 @@ let Cmds = {
|
||||
},
|
||||
|
||||
toggleToolbox: function() {
|
||||
UI.onAction("debug");
|
||||
if (UI.toolboxIframe) {
|
||||
UI.closeToolbox();
|
||||
return promise.resolve();
|
||||
@ -1021,4 +961,4 @@ let Cmds = {
|
||||
showPrefs: function() {
|
||||
UI.selectDeckPanel("prefs");
|
||||
},
|
||||
};
|
||||
}
|
||||
|
@ -25,7 +25,6 @@ const {Task} = Cu.import("resource://gre/modules/Task.jsm", {});
|
||||
const {USBRuntime, WiFiRuntime, SimulatorRuntime,
|
||||
gLocalRuntime, gRemoteRuntime} = require("devtools/webide/runtimes");
|
||||
const discovery = require("devtools/toolkit/discovery/discovery");
|
||||
const Telemetry = require("devtools/shared/telemetry");
|
||||
|
||||
const Strings = Services.strings.createBundle("chrome://browser/locale/devtools/webide.properties");
|
||||
|
||||
@ -67,8 +66,6 @@ exports.AppManager = AppManager = {
|
||||
|
||||
this.observe = this.observe.bind(this);
|
||||
Services.prefs.addObserver(WIFI_SCANNING_PREF, this, false);
|
||||
|
||||
this._telemetry = new Telemetry();
|
||||
},
|
||||
|
||||
uninit: function() {
|
||||
@ -348,25 +345,6 @@ exports.AppManager = AppManager = {
|
||||
}
|
||||
}, deferred.reject);
|
||||
|
||||
// Record connection result in telemetry
|
||||
let logResult = result => {
|
||||
this._telemetry.log("DEVTOOLS_WEBIDE_CONNECTION_RESULT", result);
|
||||
if (runtime.type) {
|
||||
this._telemetry.log("DEVTOOLS_WEBIDE_" + runtime.type +
|
||||
"_CONNECTION_RESULT", result);
|
||||
}
|
||||
};
|
||||
deferred.promise.then(() => logResult(true), () => logResult(false));
|
||||
|
||||
// If successful, record connection time in telemetry
|
||||
deferred.promise.then(() => {
|
||||
const timerId = "DEVTOOLS_WEBIDE_CONNECTION_TIME_SECONDS";
|
||||
this._telemetry.startTimer(timerId);
|
||||
this.connection.once(Connection.Events.STATUS_CHANGED, () => {
|
||||
this._telemetry.stopTimer(timerId);
|
||||
});
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
},
|
||||
|
||||
|
@ -13,21 +13,11 @@ const promise = require("promise");
|
||||
|
||||
const Strings = Services.strings.createBundle("chrome://browser/locale/devtools/webide.properties");
|
||||
|
||||
// These type strings are used for logging events to Telemetry
|
||||
let RuntimeTypes = {
|
||||
usb: "USB",
|
||||
wifi: "WIFI",
|
||||
simulator: "SIMULATOR",
|
||||
remote: "REMOTE",
|
||||
local: "LOCAL"
|
||||
};
|
||||
|
||||
function USBRuntime(id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
USBRuntime.prototype = {
|
||||
type: RuntimeTypes.usb,
|
||||
connect: function(connection) {
|
||||
let device = Devices.getByName(this.id);
|
||||
if (!device) {
|
||||
@ -69,7 +59,6 @@ function WiFiRuntime(deviceName) {
|
||||
}
|
||||
|
||||
WiFiRuntime.prototype = {
|
||||
type: RuntimeTypes.wifi,
|
||||
connect: function(connection) {
|
||||
let service = discovery.getRemoteService("devtools", this.deviceName);
|
||||
if (!service) {
|
||||
@ -93,7 +82,6 @@ function SimulatorRuntime(version) {
|
||||
}
|
||||
|
||||
SimulatorRuntime.prototype = {
|
||||
type: RuntimeTypes.simulator,
|
||||
connect: function(connection) {
|
||||
let port = ConnectionManager.getFreeTCPPort();
|
||||
let simulator = Simulator.getByVersion(this.version);
|
||||
@ -116,7 +104,6 @@ SimulatorRuntime.prototype = {
|
||||
}
|
||||
|
||||
let gLocalRuntime = {
|
||||
type: RuntimeTypes.local,
|
||||
connect: function(connection) {
|
||||
if (!DebuggerServer.initialized) {
|
||||
DebuggerServer.init();
|
||||
@ -133,7 +120,6 @@ let gLocalRuntime = {
|
||||
}
|
||||
|
||||
let gRemoteRuntime = {
|
||||
type: RuntimeTypes.remote,
|
||||
connect: function(connection) {
|
||||
let win = Services.wm.getMostRecentWindow("devtools:webide");
|
||||
if (!win) {
|
||||
|
@ -31,4 +31,3 @@ support-files =
|
||||
[test_manifestUpdate.html]
|
||||
[test_addons.html]
|
||||
[test_deviceinfo.html]
|
||||
[test_telemetry.html]
|
||||
|
@ -81,9 +81,8 @@ function removeAllProjects() {
|
||||
return Task.spawn(function* () {
|
||||
yield AppProjects.load();
|
||||
let projects = AppProjects.store.object.projects;
|
||||
// AppProjects.remove mutates the projects array in-place
|
||||
while (projects.length > 0) {
|
||||
yield AppProjects.remove(projects[0].location);
|
||||
for (let i = 0; i < projects.length; i++) {
|
||||
yield AppProjects.remove(projects[i].location);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -97,14 +96,6 @@ function nextTick() {
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
function waitForTime(time) {
|
||||
let deferred = promise.defer();
|
||||
setTimeout(() => {
|
||||
deferred.resolve();
|
||||
}, time);
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
function documentIsLoaded(doc) {
|
||||
let deferred = promise.defer();
|
||||
if (doc.readyState == "complete") {
|
||||
|
@ -20,11 +20,8 @@
|
||||
|
||||
Task.spawn(function* () {
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
DebuggerServer.init(function () { return true; });
|
||||
DebuggerServer.addBrowserActors();
|
||||
}
|
||||
DebuggerServer.init(function () { return true; });
|
||||
DebuggerServer.addBrowserActors();
|
||||
|
||||
let win = yield openWebIDE();
|
||||
|
||||
|
@ -29,11 +29,8 @@
|
||||
}
|
||||
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
DebuggerServer.init(function () { return true; });
|
||||
DebuggerServer.addBrowserActors();
|
||||
}
|
||||
DebuggerServer.init(function () { return true; });
|
||||
DebuggerServer.addBrowserActors();
|
||||
|
||||
let win = yield openWebIDE();
|
||||
|
||||
|
@ -1,250 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf8">
|
||||
<title></title>
|
||||
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/chrome-harness.js"></script>
|
||||
<script type="application/javascript;version=1.8" src="head.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<script type="application/javascript;version=1.8">
|
||||
const Telemetry = require("devtools/shared/telemetry");
|
||||
const { USBRuntime, WiFiRuntime, SimulatorRuntime, gRemoteRuntime,
|
||||
gLocalRuntime } = require("devtools/webide/runtimes");
|
||||
|
||||
// Because we need to gather stats for the period of time that a tool has
|
||||
// been opened we make use of setTimeout() to create tool active times.
|
||||
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() {
|
||||
return Task.spawn(function*() {
|
||||
let win = yield openWebIDE();
|
||||
// Wait a bit, so we're open for a non-zero time
|
||||
yield waitForTime(TOOL_DELAY);
|
||||
yield closeWebIDE(win);
|
||||
});
|
||||
}
|
||||
|
||||
function addFakeRuntimes(win) {
|
||||
// We use the real runtimes here (and switch out some functionality)
|
||||
// so we can ensure that logging happens as it would in real use.
|
||||
|
||||
let usb = new USBRuntime("fakeUSB");
|
||||
// Use local pipe instead
|
||||
usb.connect = function(connection) {
|
||||
ok(connection, win.AppManager.connection, "connection is valid");
|
||||
connection.host = null; // force connectPipe
|
||||
connection.connect();
|
||||
return promise.resolve();
|
||||
};
|
||||
win.AppManager.runtimeList.usb.push(usb);
|
||||
|
||||
let wifi = new WiFiRuntime("fakeWiFi");
|
||||
// Use local pipe instead
|
||||
wifi.connect = function(connection) {
|
||||
ok(connection, win.AppManager.connection, "connection is valid");
|
||||
connection.host = null; // force connectPipe
|
||||
connection.connect();
|
||||
return promise.resolve();
|
||||
};
|
||||
win.AppManager.runtimeList.wifi.push(wifi);
|
||||
|
||||
let sim = new SimulatorRuntime("fakeSimulator");
|
||||
// Use local pipe instead
|
||||
sim.connect = function(connection) {
|
||||
ok(connection, win.AppManager.connection, "connection is valid");
|
||||
connection.host = null; // force connectPipe
|
||||
connection.connect();
|
||||
return promise.resolve();
|
||||
};
|
||||
sim.getName = function() {
|
||||
return this.version;
|
||||
};
|
||||
win.AppManager.runtimeList.simulator.push(sim);
|
||||
|
||||
let remote = gRemoteRuntime;
|
||||
// Use local pipe instead
|
||||
remote.connect = function(connection) {
|
||||
ok(connection, win.AppManager.connection, "connection is valid");
|
||||
connection.host = null; // force connectPipe
|
||||
connection.connect();
|
||||
return promise.resolve();
|
||||
};
|
||||
let local = gLocalRuntime;
|
||||
win.AppManager.runtimeList.custom = [gRemoteRuntime, gLocalRuntime];
|
||||
|
||||
win.AppManager.update("runtimelist");
|
||||
}
|
||||
|
||||
function addTestApp(win) {
|
||||
return Task.spawn(function*() {
|
||||
let packagedAppLocation = getTestFilePath("app");
|
||||
yield win.Cmds.importPackagedApp(packagedAppLocation);
|
||||
});
|
||||
}
|
||||
|
||||
function startConnection(win, type, index) {
|
||||
let panelNode = win.document.querySelector("#runtime-panel");
|
||||
let items = panelNode.querySelectorAll(".runtime-panel-item-" + type);
|
||||
if (index === undefined) {
|
||||
is(items.length, 1, "Found one runtime button");
|
||||
}
|
||||
|
||||
let deferred = promise.defer();
|
||||
win.AppManager.connection.once(
|
||||
win.Connection.Events.CONNECTED,
|
||||
() => deferred.resolve());
|
||||
|
||||
items[index || 0].click();
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
function waitUntilConnected(win) {
|
||||
return Task.spawn(function*() {
|
||||
ok(win.document.querySelector("window").className, "busy", "UI is busy");
|
||||
yield win.UI._busyPromise;
|
||||
is(Object.keys(DebuggerServer._connections).length, 1, "Connected");
|
||||
});
|
||||
}
|
||||
|
||||
function connectToRuntime(win, type, index) {
|
||||
return Task.spawn(function*() {
|
||||
yield startConnection(win, type, index);
|
||||
yield waitUntilConnected(win);
|
||||
});
|
||||
}
|
||||
|
||||
function checkResults() {
|
||||
let result = Telemetry.prototype.telemetryInfo;
|
||||
for (let [histId, value] of Iterator(result)) {
|
||||
if (histId.endsWith("OPENED_PER_USER_FLAG")) {
|
||||
ok(value.length === 1 && !!value[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;
|
||||
});
|
||||
|
||||
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");
|
||||
} else if (histId === "DEVTOOLS_WEBIDE_CONNECTION_RESULT") {
|
||||
ok(value.length === 5, histId + " has 5 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 === 5, histId + " has 5 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 === 5, histId + " has 5 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() {
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
SimpleTest.registerCleanupFunction(() => {
|
||||
Task.spawn(function*() {
|
||||
DebuggerServer.destroy();
|
||||
yield removeAllProjects();
|
||||
resetTelemetry();
|
||||
});
|
||||
});
|
||||
|
||||
Task.spawn(function*() {
|
||||
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
DebuggerServer.init(function () { return true; });
|
||||
DebuggerServer.addBrowserActors();
|
||||
}
|
||||
|
||||
patchTelemetry();
|
||||
|
||||
// Cycle once, so we can test for multiple opens
|
||||
yield cycleWebIDE();
|
||||
|
||||
let win = yield openWebIDE();
|
||||
// Wait a bit, so we're open for a non-zero time
|
||||
yield waitForTime(TOOL_DELAY);
|
||||
addFakeRuntimes(win);
|
||||
yield addTestApp(win);
|
||||
|
||||
// Each one should log a connection result and non-zero connection
|
||||
// time
|
||||
yield connectToRuntime(win, "usb");
|
||||
yield waitForTime(TOOL_DELAY);
|
||||
yield connectToRuntime(win, "wifi");
|
||||
yield waitForTime(TOOL_DELAY);
|
||||
yield connectToRuntime(win, "simulator");
|
||||
yield waitForTime(TOOL_DELAY);
|
||||
yield connectToRuntime(win, "custom", 0 /* remote */);
|
||||
yield waitForTime(TOOL_DELAY);
|
||||
yield connectToRuntime(win, "custom", 1 /* local */);
|
||||
yield waitForTime(TOOL_DELAY);
|
||||
yield closeWebIDE(win);
|
||||
|
||||
checkResults();
|
||||
|
||||
SimpleTest.finish();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -5895,11 +5895,6 @@
|
||||
"kind": "boolean",
|
||||
"description": "How many times has the devtool's Developer Toolbar been opened via the toolbox button?"
|
||||
},
|
||||
"DEVTOOLS_WEBIDE_OPENED_BOOLEAN": {
|
||||
"expires_in_version": "never",
|
||||
"kind": "boolean",
|
||||
"description": "How many times has the DevTools WebIDE been opened?"
|
||||
},
|
||||
"DEVTOOLS_CUSTOM_OPENED_BOOLEAN": {
|
||||
"expires_in_version": "never",
|
||||
"kind": "boolean",
|
||||
@ -6015,11 +6010,6 @@
|
||||
"kind": "flag",
|
||||
"description": "How many users have opened the devtool's Developer Toolbar been opened via the toolbox button?"
|
||||
},
|
||||
"DEVTOOLS_WEBIDE_OPENED_PER_USER_FLAG": {
|
||||
"expires_in_version": "never",
|
||||
"kind": "flag",
|
||||
"description": "How many users have opened the DevTools WebIDE?"
|
||||
},
|
||||
"DEVTOOLS_CUSTOM_OPENED_PER_USER_FLAG": {
|
||||
"expires_in_version": "never",
|
||||
"kind": "flag",
|
||||
@ -6179,13 +6169,6 @@
|
||||
"n_buckets": 100,
|
||||
"description": "How long has the developer toolbar been active (seconds)"
|
||||
},
|
||||
"DEVTOOLS_WEBIDE_TIME_ACTIVE_SECONDS": {
|
||||
"expires_in_version": "never",
|
||||
"kind": "exponential",
|
||||
"high": "10000000",
|
||||
"n_buckets": 100,
|
||||
"description": "How long has WebIDE been active (seconds)"
|
||||
},
|
||||
"DEVTOOLS_CUSTOM_TIME_ACTIVE_SECONDS": {
|
||||
"expires_in_version": "never",
|
||||
"kind": "exponential",
|
||||
@ -6193,53 +6176,6 @@
|
||||
"n_buckets": 100,
|
||||
"description": "How long has a custom developer tool been active (seconds)"
|
||||
},
|
||||
"DEVTOOLS_WEBIDE_CONNECTION_RESULT": {
|
||||
"expires_in_version": "never",
|
||||
"kind": "boolean",
|
||||
"description": "Did WebIDE runtime connection succeed?"
|
||||
},
|
||||
"DEVTOOLS_WEBIDE_USB_CONNECTION_RESULT": {
|
||||
"expires_in_version": "never",
|
||||
"kind": "boolean",
|
||||
"description": "Did WebIDE USB runtime connection succeed?"
|
||||
},
|
||||
"DEVTOOLS_WEBIDE_WIFI_CONNECTION_RESULT": {
|
||||
"expires_in_version": "never",
|
||||
"kind": "boolean",
|
||||
"description": "Did WebIDE WiFi runtime connection succeed?"
|
||||
},
|
||||
"DEVTOOLS_WEBIDE_SIMULATOR_CONNECTION_RESULT": {
|
||||
"expires_in_version": "never",
|
||||
"kind": "boolean",
|
||||
"description": "Did WebIDE simulator runtime connection succeed?"
|
||||
},
|
||||
"DEVTOOLS_WEBIDE_REMOTE_CONNECTION_RESULT": {
|
||||
"expires_in_version": "never",
|
||||
"kind": "boolean",
|
||||
"description": "Did WebIDE remote runtime connection succeed?"
|
||||
},
|
||||
"DEVTOOLS_WEBIDE_LOCAL_CONNECTION_RESULT": {
|
||||
"expires_in_version": "never",
|
||||
"kind": "boolean",
|
||||
"description": "Did WebIDE local runtime connection succeed?"
|
||||
},
|
||||
"DEVTOOLS_WEBIDE_CONNECTION_TIME_SECONDS": {
|
||||
"expires_in_version": "never",
|
||||
"kind": "exponential",
|
||||
"high": "10000000",
|
||||
"n_buckets": 100,
|
||||
"description": "How long was WebIDE connected to a runtime (seconds)?"
|
||||
},
|
||||
"DEVTOOLS_WEBIDE_CONNECTION_PLAY_USED": {
|
||||
"expires_in_version": "never",
|
||||
"kind": "boolean",
|
||||
"description": "Was WebIDE's play button used during this runtime connection?"
|
||||
},
|
||||
"DEVTOOLS_WEBIDE_CONNECTION_DEBUG_USED": {
|
||||
"expires_in_version": "never",
|
||||
"kind": "boolean",
|
||||
"description": "Was WebIDE's debug button used during this runtime connection?"
|
||||
},
|
||||
"BROWSER_IS_USER_DEFAULT": {
|
||||
"expires_in_version": "never",
|
||||
"kind": "boolean",
|
||||
|
@ -67,12 +67,8 @@ function runTests() {
|
||||
}, false);
|
||||
|
||||
// Instantiate a minimal server
|
||||
if (!DebuggerServer.initialized) {
|
||||
DebuggerServer.init(function () { return true; });
|
||||
}
|
||||
if (!DebuggerServer.createRootActor) {
|
||||
DebuggerServer.addBrowserActors();
|
||||
}
|
||||
DebuggerServer.init(function () { return true; });
|
||||
DebuggerServer.addBrowserActors();
|
||||
|
||||
function firstClient() {
|
||||
// Fake a first connection to an iframe
|
||||
|
@ -22,10 +22,8 @@ window.onload = function() {
|
||||
Cu.import("resource://gre/modules/devtools/Loader.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
DebuggerServer.init(function () { return true; });
|
||||
DebuggerServer.addBrowserActors();
|
||||
}
|
||||
DebuggerServer.init(function () { return true; });
|
||||
DebuggerServer.addBrowserActors();
|
||||
|
||||
var {ConnectionManager, Connection} = devtools.require("devtools/client/connection-manager");
|
||||
|
||||
|
@ -28,10 +28,8 @@ window.onload = function() {
|
||||
|
||||
var {getDeviceFront} = devtools.require("devtools/server/actors/device");
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
DebuggerServer.init(function () { return true; });
|
||||
DebuggerServer.addBrowserActors();
|
||||
}
|
||||
DebuggerServer.init(function () { return true; });
|
||||
DebuggerServer.addBrowserActors();
|
||||
|
||||
var client = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
client.connect(function onConnect() {
|
||||
|
@ -34,10 +34,8 @@ window.onload = function() {
|
||||
|
||||
var {FramerateFront} = devtools.require("devtools/server/actors/framerate");
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
DebuggerServer.init(function () { return true; });
|
||||
DebuggerServer.addBrowserActors();
|
||||
}
|
||||
DebuggerServer.init(function () { return true; });
|
||||
DebuggerServer.addBrowserActors();
|
||||
|
||||
var client = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
client.connect(function onConnect() {
|
||||
|
@ -34,10 +34,8 @@ window.onload = function() {
|
||||
|
||||
var {FramerateFront} = devtools.require("devtools/server/actors/framerate");
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
DebuggerServer.init(function () { return true; });
|
||||
DebuggerServer.addBrowserActors();
|
||||
}
|
||||
DebuggerServer.init(function () { return true; });
|
||||
DebuggerServer.addBrowserActors();
|
||||
|
||||
var client = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
client.connect(function onConnect() {
|
||||
|
@ -37,10 +37,8 @@ window.onload = function() {
|
||||
var STOP_TICK = 3000;
|
||||
var TOTAL_TIME = 5000;
|
||||
|
||||
if (!DebuggerServer.initialized) {
|
||||
DebuggerServer.init(function () { return true; });
|
||||
DebuggerServer.addBrowserActors();
|
||||
}
|
||||
DebuggerServer.init(function () { return true; });
|
||||
DebuggerServer.addBrowserActors();
|
||||
|
||||
var client = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
client.connect(function onConnect() {
|
||||
|
Loading…
Reference in New Issue
Block a user