forked from mirrors/gecko-dev
Bug 1453383 - Enable ESLint for devtools/client/{webaudioeditor,webide}/. r=jdescottes
MozReview-Commit-ID: Gm77Z0T3oJq --HG-- extra : rebase_source : 9a23baa102558d30302baf5044da207b7d79f3b6
This commit is contained in:
parent
6a7d7e5b8c
commit
d226fcc86a
34 changed files with 83 additions and 82 deletions
|
|
@ -116,17 +116,9 @@ devtools/client/storage/test/*.html
|
|||
!devtools/client/storage/test/storage-search.html
|
||||
!devtools/client/storage/test/storage-unsecured-iframe.html
|
||||
!devtools/client/storage/test/storage-unsecured-iframe-usercontextid.html
|
||||
devtools/client/webaudioeditor/**
|
||||
devtools/client/webconsole/old/net/**
|
||||
!devtools/client/webconsole/test/mochitest/**
|
||||
devtools/client/webconsole/old/test/**
|
||||
devtools/client/webconsole/old/webconsole.js
|
||||
devtools/client/webide/**
|
||||
!devtools/client/webide/components/webideCli.js
|
||||
devtools/server/tests/browser/storage-*.html
|
||||
!devtools/server/tests/browser/storage-unsecured-iframe.html
|
||||
devtools/server/tests/browser/stylesheets-nested-iframes.html
|
||||
devtools/server/tests/unit/xpcshell_debugging_script.js
|
||||
devtools/client/shared/webpack/shims/test/test_clipboard.html
|
||||
devtools/shared/qrcode/tests/mochitest/test_decode.html
|
||||
devtools/shared/tests/mochitest/*.html
|
||||
|
|
@ -137,6 +129,10 @@ devtools/client/commandline/**
|
|||
# Soon to be removed, the new/ directory is explicitly excluded below due to
|
||||
# also being an imported repository.
|
||||
devtools/client/debugger/**
|
||||
# Soon to be removed
|
||||
devtools/client/webconsole/old/net/**
|
||||
devtools/client/webconsole/old/test/**
|
||||
devtools/client/webconsole/old/webconsole.js
|
||||
|
||||
# Ignore devtools imported repositories
|
||||
devtools/client/debugger/new/**
|
||||
|
|
@ -144,6 +140,7 @@ devtools/client/shared/components/reps/**
|
|||
|
||||
# Ignore devtools preferences files
|
||||
devtools/client/preferences/**
|
||||
devtools/client/webide/preferences/**
|
||||
devtools/shared/preferences/**
|
||||
devtools/startup/preferences/devtools-startup.js
|
||||
|
||||
|
|
@ -180,6 +177,9 @@ devtools/server/tests/unit/babel_and_browserify_script_with_source_map.js
|
|||
devtools/server/tests/unit/setBreakpoint*
|
||||
devtools/server/tests/unit/sourcemapped.js
|
||||
|
||||
# devtools specific format test file
|
||||
devtools/server/tests/unit/xpcshell_debugging_script.js
|
||||
|
||||
# dom/ exclusions
|
||||
dom/abort/**
|
||||
dom/animation/**
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ module.exports = {
|
|||
"client/scratchpad/**",
|
||||
"client/shared/*.jsm",
|
||||
"client/shared/widgets/*.jsm",
|
||||
"client/webide/**",
|
||||
],
|
||||
"rules": {
|
||||
"consistent-return": "off",
|
||||
|
|
@ -56,6 +57,7 @@ module.exports = {
|
|||
"client/framework/**",
|
||||
"client/scratchpad/**",
|
||||
"client/shared/AppCacheUtils.jsm",
|
||||
"client/webide/**",
|
||||
],
|
||||
"rules": {
|
||||
"max-nested-callbacks": "off",
|
||||
|
|
@ -66,6 +68,7 @@ module.exports = {
|
|||
"client/scratchpad/**",
|
||||
"client/shared/*.jsm",
|
||||
"client/shared/widgets/*.jsm",
|
||||
"client/webide/**",
|
||||
],
|
||||
"rules": {
|
||||
"max-len": "off",
|
||||
|
|
@ -84,6 +87,7 @@ module.exports = {
|
|||
"client/scratchpad/**",
|
||||
"client/shared/*.jsm",
|
||||
"client/shared/widgets/*.jsm",
|
||||
"client/webide/**",
|
||||
],
|
||||
"rules": {
|
||||
"mozilla/no-aArgs": "off",
|
||||
|
|
@ -102,6 +106,7 @@ module.exports = {
|
|||
"client/scratchpad/**",
|
||||
"client/shared/AppCacheUtils.jsm",
|
||||
"client/shared/widgets/*.jsm",
|
||||
"client/webide/**",
|
||||
],
|
||||
"rules": {
|
||||
"no-shadow": "off",
|
||||
|
|
@ -110,6 +115,7 @@ module.exports = {
|
|||
"files": [
|
||||
"client/framework/**",
|
||||
"client/scratchpad/**",
|
||||
"client/webide/**",
|
||||
],
|
||||
"rules": {
|
||||
"strict": "off",
|
||||
|
|
@ -122,16 +128,21 @@ module.exports = {
|
|||
// Note: Bug 1342237 may be removing shadereditor, check before
|
||||
// doing more work on enabling these rules.
|
||||
"client/shadereditor/**",
|
||||
// Note: Bug 1403944 may be removing webaudioeditor, check before
|
||||
// doing more work on enabling these rules.
|
||||
"client/webaudioeditor/**",
|
||||
],
|
||||
"rules": {
|
||||
"consistent-return": "off",
|
||||
"max-len": "off",
|
||||
"mozilla/no-aArgs": "off",
|
||||
"mozilla/var-only-at-top-level": "off",
|
||||
"no-redeclare": "off",
|
||||
"no-return-assign": "off",
|
||||
"no-shadow": "off",
|
||||
"no-undef": "off",
|
||||
"no-unused-vars": "off",
|
||||
"no-useless-call": "off",
|
||||
"strict": "off",
|
||||
}
|
||||
}, {
|
||||
|
|
|
|||
|
|
@ -180,6 +180,7 @@ class AudioNodesCollection extends EventEmitter {
|
|||
* @return AudioNodeModel
|
||||
*/
|
||||
add(obj) {
|
||||
// eslint-disable-next-line new-cap
|
||||
let node = new this.model(obj);
|
||||
node.collection = this;
|
||||
|
||||
|
|
|
|||
|
|
@ -37,17 +37,17 @@ add_task(async function() {
|
|||
}, "default loaded string");
|
||||
|
||||
click(panelWin, findGraphNode(panelWin, nodeIds[2]));
|
||||
await waitForInspectorRender(panelWin, EVENTS),
|
||||
await waitForInspectorRender(panelWin, EVENTS);
|
||||
checkVariableView(gVars, 0, {
|
||||
"gain": 0
|
||||
}, "default loaded number");
|
||||
|
||||
click(panelWin, findGraphNode(panelWin, nodeIds[1]));
|
||||
await waitForInspectorRender(panelWin, EVENTS),
|
||||
await waitForInspectorRender(panelWin, EVENTS);
|
||||
await setAndCheck(0, "type", "square", "square", "sets string as string");
|
||||
|
||||
click(panelWin, findGraphNode(panelWin, nodeIds[2]));
|
||||
await waitForInspectorRender(panelWin, EVENTS),
|
||||
await waitForInspectorRender(panelWin, EVENTS);
|
||||
await setAndCheck(0, "gain", "0.005", 0.005, "sets number as number");
|
||||
await setAndCheck(0, "gain", "0.1", 0.1, "sets float as float");
|
||||
await setAndCheck(0, "gain", ".2", 0.2, "sets float without leading zero as float");
|
||||
|
|
|
|||
|
|
@ -17,18 +17,18 @@
|
|||
// side.
|
||||
var keepAlive = [];
|
||||
(function() {
|
||||
let ctx = new AudioContext();
|
||||
let osc = ctx.createOscillator();
|
||||
let gain = ctx.createGain();
|
||||
let ctx = new AudioContext();
|
||||
let osc = ctx.createOscillator();
|
||||
let gain = ctx.createGain();
|
||||
|
||||
for (let i = 0; i < 10; i++) {
|
||||
keepAlive.push(ctx.createBufferSource());
|
||||
}
|
||||
for (let i = 0; i < 10; i++) {
|
||||
keepAlive.push(ctx.createBufferSource());
|
||||
}
|
||||
|
||||
osc.connect(gain);
|
||||
gain.connect(ctx.destination);
|
||||
gain.gain.value = 0;
|
||||
osc.start();
|
||||
osc.connect(gain);
|
||||
gain.connect(ctx.destination);
|
||||
gain.gain.value = 0;
|
||||
osc.start();
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ function getN(front, eventName, count, spread) {
|
|||
let actors = [];
|
||||
info(`Waiting for ${count} ${eventName} events`);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise((resolve) => {
|
||||
front.on(eventName, function onEvent(...args) {
|
||||
let actor = args[0];
|
||||
if (actors.length !== count) {
|
||||
|
|
@ -164,7 +164,7 @@ function waitForGraphRendered(front, nodeCount, edgeCount, paramEdgeCount) {
|
|||
let eventName = front.EVENTS.UI_GRAPH_RENDERED;
|
||||
info(`Wait for graph rendered with ${nodeCount} nodes, ${edgeCount} edges`);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise((resolve) => {
|
||||
front.on(eventName, function onGraphRendered(nodes, edges, pEdges) {
|
||||
let paramEdgesDone = paramEdgeCount != null ? paramEdgeCount === pEdges : true;
|
||||
info(`Got graph rendered with ${nodes} / ${nodeCount} nodes, ` +
|
||||
|
|
|
|||
|
|
@ -85,9 +85,8 @@ var InspectorView = {
|
|||
$("#web-audio-editor-details-pane-empty").removeAttribute("hidden");
|
||||
$("#web-audio-editor-tabs").setAttribute("hidden", "true");
|
||||
window.emit(EVENTS.UI_INSPECTOR_NODE_SET, null);
|
||||
}
|
||||
// Otherwise load up the tabs view and hide the empty placeholder
|
||||
else {
|
||||
} else {
|
||||
// Otherwise load up the tabs view and hide the empty placeholder
|
||||
$("#web-audio-editor-details-pane-empty").setAttribute("hidden", "true");
|
||||
$("#web-audio-editor-tabs").removeAttribute("hidden");
|
||||
this._buildToolbar();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
const {require} = ChromeUtils.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const Services = require("Services");
|
||||
const {AppManager} = require("devtools/client/webide/modules/app-manager");
|
||||
|
||||
window.addEventListener("load", function() {
|
||||
|
|
@ -117,6 +116,8 @@ function updateUI() {
|
|||
AppManager.update("details");
|
||||
}
|
||||
|
||||
// Used in details.xhtml.
|
||||
/* exported removeProject */
|
||||
function removeProject() {
|
||||
AppManager.removeSelectedProject();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,9 @@ function SearchField(event) {
|
|||
configView.search(event);
|
||||
}
|
||||
|
||||
var getAllPrefs; // Used by tests
|
||||
// Used by tests
|
||||
/* exported getAllPrefs */
|
||||
var getAllPrefs;
|
||||
function BuildUI() {
|
||||
configView.resetTable();
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
"use strict";
|
||||
|
||||
const {require} = ChromeUtils.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const Services = require("Services");
|
||||
const {FileUtils} = require("resource://gre/modules/FileUtils.jsm");
|
||||
const {AppProjects} = require("devtools/client/webide/modules/app-projects");
|
||||
|
|
@ -67,8 +66,7 @@ function getTemplatesJSON() {
|
|||
}
|
||||
|
||||
function failAndBail(msg) {
|
||||
let promptService = Cc["@mozilla.org/embedcomp/prompt-service;1"].getService(Ci.nsIPromptService);
|
||||
promptService.alert(window, "error", msg);
|
||||
Services.prompt.alert(window, "error", msg);
|
||||
window.close();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/* exported ProjectPanel */
|
||||
var ProjectPanel = {
|
||||
// TODO: Expand function to save toggle state.
|
||||
toggleSidebar: function() {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/* exported RuntimePanel */
|
||||
var RuntimePanel = {
|
||||
// TODO: Expand function to save toggle state.
|
||||
toggleSidebar: function() {
|
||||
|
|
|
|||
|
|
@ -52,7 +52,9 @@ function generateFields(json) {
|
|||
}
|
||||
}
|
||||
|
||||
var getDescriptionPromise; // Used by tests
|
||||
// Used by tests
|
||||
/* exported getDescriptionPromise */
|
||||
var getDescriptionPromise;
|
||||
function BuildUI() {
|
||||
let table = document.querySelector("table");
|
||||
table.innerHTML = "";
|
||||
|
|
@ -70,7 +72,6 @@ function CheckLockState() {
|
|||
let adbCheckResult = document.querySelector("#adb-check > .yesno");
|
||||
let devtoolsCheckResult = document.querySelector("#devtools-check > .yesno");
|
||||
let flipCertPerfButton = document.querySelector("#devtools-check button");
|
||||
let adbRootButton = document.querySelector("#adb-check button");
|
||||
let flipCertPerfAction = document.querySelector("#devtools-check > .action");
|
||||
let adbRootAction = document.querySelector("#adb-check > .action");
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,10 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// These files are loaded via webide.xul
|
||||
/* import-globals-from project-panel.js */
|
||||
/* import-globals-from runtime-panel.js */
|
||||
|
||||
const {require} = ChromeUtils.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const {gDevTools} = require("devtools/client/framework/devtools");
|
||||
const {gDevToolsBrowser} = require("devtools/client/framework/devtools-browser");
|
||||
|
|
@ -14,14 +18,12 @@ const EventEmitter = require("devtools/shared/event-emitter");
|
|||
const promise = require("promise");
|
||||
const {GetAvailableAddons} = require("devtools/client/webide/modules/addons");
|
||||
const {getJSON} = require("devtools/client/shared/getjson");
|
||||
const utils = require("devtools/client/webide/modules/utils");
|
||||
const Telemetry = require("devtools/client/shared/telemetry");
|
||||
const {RuntimeScanners} = require("devtools/client/webide/modules/runtimes");
|
||||
const {showDoorhanger} = require("devtools/client/shared/doorhanger");
|
||||
|
||||
const Strings = Services.strings.createBundle("chrome://devtools/locale/webide.properties");
|
||||
|
||||
const HTML = "http://www.w3.org/1999/xhtml";
|
||||
const HELP_URL = "https://developer.mozilla.org/docs/Tools/WebIDE/Troubleshooting";
|
||||
|
||||
const MAX_ZOOM = 1.4;
|
||||
|
|
@ -435,7 +437,7 @@ var UI = {
|
|||
!this.lastConnectedRuntime) {
|
||||
return;
|
||||
}
|
||||
let [_, type, id] = this.lastConnectedRuntime.match(/^(\w+):(.+)$/);
|
||||
let [ , type, id] = this.lastConnectedRuntime.match(/^(\w+):(.+)$/);
|
||||
|
||||
type = type.toLowerCase();
|
||||
|
||||
|
|
@ -658,7 +660,7 @@ var UI = {
|
|||
if (!m) {
|
||||
return;
|
||||
}
|
||||
let [_, type, project] = m;
|
||||
let [ , type, project] = m;
|
||||
|
||||
if (type == "local") {
|
||||
let lastProject = AppProjects.get(project);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
const { require } =
|
||||
ChromeUtils.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const Services = require("Services");
|
||||
const QR = require("devtools/shared/qrcode/index");
|
||||
|
||||
window.addEventListener("load", function() {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
const {AddonManager} = require("resource://gre/modules/AddonManager.jsm");
|
||||
const Services = require("Services");
|
||||
const {getJSON} = require("devtools/client/shared/getjson");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
|
||||
var ADB_LINK = Services.prefs.getCharPref("devtools.webide.adbAddonURL");
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
const {Cu} = require("chrome");
|
||||
|
||||
const {TargetFactory} = require("devtools/client/framework/target");
|
||||
const Services = require("Services");
|
||||
const {FileUtils} = require("resource://gre/modules/FileUtils.jsm");
|
||||
|
|
@ -579,8 +577,6 @@ var AppManager = exports.AppManager = {
|
|||
return;
|
||||
}
|
||||
|
||||
let installPromise;
|
||||
|
||||
if (project.type != "packaged" && project.type != "hosted") {
|
||||
return Promise.reject("Don't know how to install project");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
const {Cc, Ci, Cu, Cr} = require("chrome");
|
||||
const {Cc, Ci, Cr} = require("chrome");
|
||||
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const {generateUUID} = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator);
|
||||
|
|
@ -100,9 +100,9 @@ const IDB = {
|
|||
|
||||
update: function(project) {
|
||||
return new Promise((resolve, reject) => {
|
||||
var transaction = IDB._db.transaction(["projects"], "readwrite");
|
||||
var objectStore = transaction.objectStore("projects");
|
||||
var request = objectStore.put(project);
|
||||
let transaction = IDB._db.transaction(["projects"], "readwrite");
|
||||
let objectStore = transaction.objectStore("projects");
|
||||
let request = objectStore.put(project);
|
||||
request.onerror = function(event) {
|
||||
reject("Unable to update project to the AppProjects indexedDB: " +
|
||||
this.error.name + " - " + this.error.message);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
"use strict";
|
||||
|
||||
var {Ci, Cu} = require("chrome");
|
||||
var {Ci} = require("chrome");
|
||||
|
||||
const {FileUtils} = require("resource://gre/modules/FileUtils.jsm");
|
||||
const Services = require("Services");
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
const {Cu} = require("chrome");
|
||||
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const Services = require("Services");
|
||||
const Strings = Services.strings.createBundle("chrome://devtools/locale/webide.properties");
|
||||
|
|
@ -76,7 +74,7 @@ ConfigView.prototype = {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
var trs = this._doc.getElementById("device-fields").querySelectorAll("tr");
|
||||
let trs = this._doc.getElementById("device-fields").querySelectorAll("tr");
|
||||
|
||||
for (let i = 0; i < trs.length; i++) {
|
||||
trs[i].classList.remove("hide");
|
||||
|
|
@ -164,7 +162,7 @@ ConfigView.prototype = {
|
|||
let table = this._doc.querySelector("table");
|
||||
let trs = table.querySelectorAll("tr:not(#add-custom-field)");
|
||||
|
||||
for (var i = 0; i < trs.length; i++) {
|
||||
for (let i = 0; i < trs.length; i++) {
|
||||
table.removeChild(trs[i]);
|
||||
}
|
||||
|
||||
|
|
@ -299,7 +297,6 @@ ConfigView.prototype = {
|
|||
let table = this._doc.querySelector("table");
|
||||
let customValueType = table.querySelector("#custom-value-type").value;
|
||||
let customTextEl = table.querySelector("#custom-value-text");
|
||||
let customText = customTextEl.value;
|
||||
|
||||
if (customValueType.length === 0) {
|
||||
return false;
|
||||
|
|
@ -308,10 +305,8 @@ ConfigView.prototype = {
|
|||
switch (customValueType) {
|
||||
case "boolean":
|
||||
customTextEl.type = "checkbox";
|
||||
customText = customTextEl.checked;
|
||||
break;
|
||||
case "number":
|
||||
customText = parseInt(customText, 10) || 0;
|
||||
customTextEl.type = "number";
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
const {Cu} = require("chrome");
|
||||
|
||||
const Services = require("Services");
|
||||
const {AppProjects} = require("devtools/client/webide/modules/app-projects");
|
||||
const {AppManager} = require("devtools/client/webide/modules/app-manager");
|
||||
|
|
@ -205,7 +203,7 @@ ProjectList.prototype = {
|
|||
let doc = this._doc;
|
||||
let runtimeappsHeaderNode = doc.querySelector("#panel-header-runtimeapps");
|
||||
let sortedApps = [];
|
||||
for (let [manifestURL, app] of AppManager.apps) {
|
||||
for (let [/* manifestURL */, app] of AppManager.apps) {
|
||||
sortedApps.push(app);
|
||||
}
|
||||
sortedApps = sortedApps.sort((a, b) => {
|
||||
|
|
|
|||
|
|
@ -4,14 +4,10 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const Services = require("Services");
|
||||
const {AppManager} = require("devtools/client/webide/modules/app-manager");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const {RuntimeScanners, WiFiScanner} = require("devtools/client/webide/modules/runtimes");
|
||||
const {Devices} = require("resource://devtools/shared/apps/Devices.jsm");
|
||||
const utils = require("devtools/client/webide/modules/utils");
|
||||
|
||||
const Strings = Services.strings.createBundle("chrome://devtools/locale/webide.properties");
|
||||
|
||||
var RuntimeList;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
const {Ci} = require("chrome");
|
||||
const Services = require("Services");
|
||||
const {Devices} = require("resource://devtools/shared/apps/Devices.jsm");
|
||||
const {Connection} = require("devtools/shared/client/connection-manager");
|
||||
const {DebuggerServer} = require("devtools/server/main");
|
||||
const discovery = require("devtools/shared/discovery/discovery");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
const { Cu } = require("chrome");
|
||||
|
||||
const { TargetFactory } = require("devtools/client/framework/target");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const { Connection } = require("devtools/shared/client/connection-manager");
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
const { Cc, Cu, Ci } = require("chrome");
|
||||
const { Cc, Ci } = require("chrome");
|
||||
const { FileUtils } = require("resource://gre/modules/FileUtils.jsm");
|
||||
const Services = require("Services");
|
||||
const Strings = Services.strings.createBundle("chrome://devtools/locale/webide.properties");
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ const TEST_URI = "http://example.com/browser/devtools/client/webide/test/doc_tab
|
|||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
requestCompleteLog();
|
||||
SimpleTest.requestCompleteLog();
|
||||
|
||||
(async function() {
|
||||
// Since we test the connections set below, destroy the server in case it
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* eslint no-unused-vars: ["error", {"args": "none", "vars": "local"}] */
|
||||
|
||||
"use strict";
|
||||
|
||||
var customName;
|
||||
|
|
@ -171,7 +173,7 @@ function addNewFieldBoolean() {
|
|||
ok(found, "Found new boolean field line");
|
||||
|
||||
// Mouse event trigger
|
||||
var mouseClick = new MouseEvent("click", {
|
||||
let mouseClick = new MouseEvent("click", {
|
||||
canBubble: true,
|
||||
cancelable: true,
|
||||
view: doc.parent,
|
||||
|
|
|
|||
|
|
@ -44,8 +44,8 @@ var openWebIDE = async function(autoInstallAddons) {
|
|||
|
||||
Services.prefs.setBoolPref("devtools.webide.autoinstallADBHelper", !!autoInstallAddons);
|
||||
|
||||
let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].getService(Ci.nsIWindowWatcher);
|
||||
let win = ww.openWindow(null, "chrome://webide/content/", "webide", "chrome,centerscreen,resizable", null);
|
||||
let win = Services.ww.openWindow(null, "chrome://webide/content/", "webide",
|
||||
"chrome,centerscreen,resizable", null);
|
||||
|
||||
await new Promise(resolve => {
|
||||
win.addEventListener("load", function() {
|
||||
|
|
|
|||
|
|
@ -15,12 +15,13 @@
|
|||
<body>
|
||||
|
||||
<script type="application/javascript">
|
||||
// XXX Bug 1072167 - When updating after migration, fix the no-undef issues.
|
||||
/* eslint-disable no-undef */
|
||||
|
||||
window.onload = function() {
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
const {Devices} = ChromeUtils.import("resource://devtools/shared/apps/Devices.jsm");
|
||||
|
||||
let adbAddonsInstalled;
|
||||
const {Devices} = ChromeUtils.import("resource://devtools/shared/apps/Devices.jsm", {});
|
||||
|
||||
function uninstallADBFromUI(doc) {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
|
@ -44,7 +45,6 @@
|
|||
ok(!Devices.helperAddonInstalled, "Helper not installed");
|
||||
|
||||
let win = await openWebIDE(true);
|
||||
let docRuntime = getRuntimeDocument(win);
|
||||
|
||||
ok(Devices.helperAddonInstalled, "Helper has been auto-installed");
|
||||
|
||||
|
|
|
|||
|
|
@ -21,17 +21,15 @@
|
|||
const Services = require("Services");
|
||||
const nsFile = Components.Constructor("@mozilla.org/file/local;1",
|
||||
"nsIFile", "initWithPath");
|
||||
const cr = Cc["@mozilla.org/chrome/chrome-registry;1"]
|
||||
.getService(Ci.nsIChromeRegistry);
|
||||
const strings = Services.strings.createBundle("chrome://devtools/locale/app-manager.properties");
|
||||
let httpserver, origin;
|
||||
let httpserver, fakeOrigin;
|
||||
|
||||
window.onload = function() {
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
httpserver = new HttpServer();
|
||||
httpserver.start(-1);
|
||||
origin = "http://localhost:" + httpserver.identity.primaryPort + "/";
|
||||
fakeOrigin = "http://localhost:" + httpserver.identity.primaryPort + "/";
|
||||
|
||||
next();
|
||||
};
|
||||
|
|
@ -41,7 +39,7 @@
|
|||
httpserver.registerDirectory("/", nsFile(dirPath));
|
||||
return new AppValidator({
|
||||
type: "hosted",
|
||||
location: origin + manifestFile
|
||||
location: fakeOrigin + manifestFile
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -95,7 +93,7 @@
|
|||
let validator = createHosted("wrong-launch-path");
|
||||
validator.validate().then(() => {
|
||||
is(validator.errors.length, 1, "app with non-existant launch path got an error");
|
||||
is(validator.errors[0], strings.formatStringFromName("validator.accessFailedLaunchPathBadHttpCode", [origin + "wrong-path.html", 404], 2),
|
||||
is(validator.errors[0], strings.formatStringFromName("validator.accessFailedLaunchPathBadHttpCode", [fakeOrigin + "wrong-path.html", 404], 2),
|
||||
"with the right error message");
|
||||
is(validator.warnings.length, 0, "but no warning");
|
||||
next();
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
<body>
|
||||
|
||||
<script type="application/javascript">
|
||||
/* import-globals-from device_front_shared.js */
|
||||
window.onload = function() {
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@
|
|||
|
||||
// Read file
|
||||
let manifestPath = OS.Path.join(packagedAppLocation, "manifest.webapp");
|
||||
let Decoder = new TextDecoder();
|
||||
let data = await OS.File.read(manifestPath);
|
||||
data = new TextDecoder().decode(data);
|
||||
let json = JSON.parse(data);
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@
|
|||
ok(win.document.querySelector("window").className, "busy", "UI is busy");
|
||||
|
||||
// Wait for error message since connection never completes
|
||||
let errorDeferred = new Promise(resolve => {
|
||||
await new Promise(resolve => {
|
||||
win.UI.reportError = errorName => {
|
||||
if (errorName === "error_operationTimeout") {
|
||||
resolve();
|
||||
|
|
@ -190,6 +190,8 @@
|
|||
}, 1000);
|
||||
});
|
||||
|
||||
await noErrorDeferred;
|
||||
|
||||
SimpleTest.finish();
|
||||
})();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -51,6 +51,8 @@
|
|||
ok(win.document.querySelector("window").className, "busy", "UI is busy");
|
||||
await win.UI._busyPromise;
|
||||
|
||||
await deferred;
|
||||
|
||||
is(Object.keys(DebuggerServer._connections).length, 1, "Connected");
|
||||
|
||||
await waitForUpdate(win, "runtime-global-actors");
|
||||
|
|
|
|||
Loading…
Reference in a new issue