mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1708626 - [devtools] Remove usage of Promise.jsm in tests. r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D113912
This commit is contained in:
parent
c33d1b0837
commit
0f8b07b880
@ -122,7 +122,7 @@ function reloadTab(tabX) {
|
||||
async function destroyTab(tabX) {
|
||||
const toolbox = await gDevTools.getToolboxForTab(tabX.tab);
|
||||
|
||||
let onceDestroyed = promise.resolve();
|
||||
let onceDestroyed;
|
||||
if (toolbox) {
|
||||
onceDestroyed = gDevTools.once("toolbox-destroyed");
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ var clickContainer = async function(selector, inspector) {
|
||||
const container = getContainerForNodeFront(nodeFront, inspector);
|
||||
|
||||
const updated = container.selected
|
||||
? promise.resolve()
|
||||
? Promise.resolve()
|
||||
: inspector.once("inspector-updated");
|
||||
EventUtils.synthesizeMouseAtCenter(
|
||||
container.tagLine,
|
||||
|
@ -138,7 +138,7 @@ function expandComputedViewPropertyByIndex(view, index) {
|
||||
info("Expanding property " + index + " in the computed view");
|
||||
const expandos = view.styleDocument.querySelectorAll(".computed-expandable");
|
||||
if (!expandos.length || !expandos[index]) {
|
||||
return promise.reject();
|
||||
return Promise.reject();
|
||||
}
|
||||
|
||||
const onExpand = view.inspector.once("computed-view-property-expanded");
|
||||
|
@ -155,7 +155,7 @@ var clickContainer = async function(selector, inspector) {
|
||||
const container = getContainerForNodeFront(nodeFront, inspector);
|
||||
|
||||
const updated = container.selected
|
||||
? promise.resolve()
|
||||
? Promise.resolve()
|
||||
: inspector.once("inspector-updated");
|
||||
EventUtils.synthesizeMouseAtCenter(
|
||||
container.tagLine,
|
||||
@ -252,7 +252,7 @@ function undoChange(inspector) {
|
||||
const canUndo = inspector.markup.undo.canUndo();
|
||||
ok(canUndo, "The last change in the markup-view can be undone");
|
||||
if (!canUndo) {
|
||||
return promise.reject();
|
||||
return Promise.reject();
|
||||
}
|
||||
|
||||
const mutated = inspector.once("markupmutation");
|
||||
@ -272,7 +272,7 @@ function redoChange(inspector) {
|
||||
const canRedo = inspector.markup.undo.canRedo();
|
||||
ok(canRedo, "The last change in the markup-view can be redone");
|
||||
if (!canRedo) {
|
||||
return promise.reject();
|
||||
return Promise.reject();
|
||||
}
|
||||
|
||||
const mutated = inspector.once("markupmutation");
|
||||
|
@ -37,12 +37,12 @@ add_task(async function() {
|
||||
this.nodeFront = nodeFront;
|
||||
this.isShown = true;
|
||||
this.nbOfTimesShown++;
|
||||
return promise.resolve(true);
|
||||
return Promise.resolve(true);
|
||||
},
|
||||
hide: function() {
|
||||
this.nodeFront = null;
|
||||
this.isShown = false;
|
||||
return promise.resolve();
|
||||
return Promise.resolve();
|
||||
},
|
||||
finalize: function() {},
|
||||
};
|
||||
|
@ -24,7 +24,7 @@ add_task(async function() {
|
||||
function doKeyPick(msg) {
|
||||
info("Key pressed. Waiting for element to be picked");
|
||||
testActor.synthesizeKey(msg);
|
||||
return promise.all([
|
||||
return Promise.all([
|
||||
inspector.selection.once("new-node-front"),
|
||||
inspector.once("inspector-updated"),
|
||||
]);
|
||||
|
@ -54,7 +54,7 @@ add_task(async function() {
|
||||
function doKeyPick(args) {
|
||||
info("Key pressed. Waiting for element to be picked");
|
||||
testActor.synthesizeKey(args);
|
||||
return promise.all([
|
||||
return Promise.all([
|
||||
inspector.selection.once("new-node-front"),
|
||||
inspector.once("inspector-updated"),
|
||||
toolbox.nodePicker.once("picker-stopped"),
|
||||
|
@ -500,7 +500,7 @@ function undoChange(inspector) {
|
||||
const canUndo = inspector.markup.undo.canUndo();
|
||||
ok(canUndo, "The last change in the markup-view can be undone");
|
||||
if (!canUndo) {
|
||||
return promise.reject();
|
||||
return Promise.reject();
|
||||
}
|
||||
|
||||
const mutated = inspector.once("markupmutation");
|
||||
@ -520,7 +520,7 @@ function redoChange(inspector) {
|
||||
const canRedo = inspector.markup.undo.canRedo();
|
||||
ok(canRedo, "The last change in the markup-view can be redone");
|
||||
if (!canRedo) {
|
||||
return promise.reject();
|
||||
return Promise.reject();
|
||||
}
|
||||
|
||||
const mutated = inspector.once("markupmutation");
|
||||
|
@ -20,7 +20,6 @@ registerCleanupFunction(() => {
|
||||
|
||||
var { OS } = require("resource://gre/modules/osfile.jsm");
|
||||
var { FileUtils } = require("resource://gre/modules/FileUtils.jsm");
|
||||
var promise = require("promise");
|
||||
var { expectState } = require("devtools/server/actors/common");
|
||||
var HeapSnapshotFileUtils = require("devtools/shared/heapsnapshot/HeapSnapshotFileUtils");
|
||||
var HeapAnalysesClient = require("devtools/shared/heapsnapshot/HeapAnalysesClient");
|
||||
|
@ -7,7 +7,6 @@
|
||||
|
||||
const { require } = ChromeUtils.import("resource://devtools/shared/Loader.jsm");
|
||||
|
||||
const promise = require("promise");
|
||||
const Services = require("Services");
|
||||
const Store = require("devtools/client/responsive/store");
|
||||
|
||||
|
@ -13,7 +13,6 @@ var { gDevTools } = require("devtools/client/framework/devtools");
|
||||
var { BrowserLoader } = ChromeUtils.import(
|
||||
"resource://devtools/client/shared/browser-loader.js"
|
||||
);
|
||||
var promise = require("promise");
|
||||
var Services = require("Services");
|
||||
var { DevToolsServer } = require("devtools/server/devtools-server");
|
||||
var { DevToolsClient } = require("devtools/client/devtools-client");
|
||||
|
@ -24,8 +24,7 @@ function test() {
|
||||
gClient.connect().then(([aType, aTraits]) => {
|
||||
is(aType, "browser", "Root actor should identify itself as a browser.");
|
||||
|
||||
promise
|
||||
.resolve(null)
|
||||
Promise.resolve(null)
|
||||
.then(testFirstTab)
|
||||
.then(testSecondTab)
|
||||
.then(testRemoveTab)
|
||||
|
@ -56,9 +56,6 @@ const {
|
||||
} = require("devtools/shared/commands/commands-factory");
|
||||
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
|
||||
// This is overridden in files that load shared-head via loadSubScript.
|
||||
// eslint-disable-next-line prefer-const
|
||||
let promise = require("promise");
|
||||
const defer = require("devtools/shared/defer");
|
||||
const KeyShortcuts = require("devtools/client/shared/key-shortcuts");
|
||||
|
||||
|
@ -28,7 +28,7 @@ add_task(async function() {
|
||||
updates.push(gUI.once("sidebar-updated"));
|
||||
gUI.updateObjectSidebar();
|
||||
}
|
||||
await promise.all(updates);
|
||||
await Promise.all(updates);
|
||||
|
||||
info("Updates performed, going to verify result");
|
||||
const parsedScope = gUI.view.getScopeAtIndex(1);
|
||||
|
@ -340,8 +340,7 @@ function findVariableViewProperties(ruleArray, parsed) {
|
||||
// Return the results - a promise resolved to hold the updated ruleArray.
|
||||
const returnResults = onAllRulesMatched.bind(null, ruleArray);
|
||||
|
||||
return promise
|
||||
.all(outstanding)
|
||||
return Promise.all(outstanding)
|
||||
.then(lastStep)
|
||||
.then(returnResults);
|
||||
}
|
||||
@ -436,7 +435,7 @@ function findVariableViewProperties(ruleArray, parsed) {
|
||||
*/
|
||||
function matchVariablesViewProperty(prop, rule) {
|
||||
function resolve(result) {
|
||||
return promise.resolve(result);
|
||||
return Promise.resolve(result);
|
||||
}
|
||||
|
||||
if (!prop) {
|
||||
|
@ -20,7 +20,7 @@ add_task(async function() {
|
||||
show: function(node, options) {
|
||||
this.isShown = true;
|
||||
this.options = options;
|
||||
return promise.resolve();
|
||||
return Promise.resolve();
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
|
@ -77,7 +77,7 @@ function testFriendlyNamesAfterSave(ui) {
|
||||
"Friendly name for the second inline sheet isn't the same as the first."
|
||||
);
|
||||
|
||||
return promise.resolve(null);
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
|
||||
function testFriendlyNamesAfterNavigation(ui) {
|
||||
@ -97,5 +97,5 @@ function testFriendlyNamesAfterNavigation(ui) {
|
||||
"The second editor doesn't have the save path as a friendly name."
|
||||
);
|
||||
|
||||
return promise.resolve(null);
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ function togglePref(UI) {
|
||||
|
||||
Services.prefs.setBoolPref(PREF, false);
|
||||
|
||||
return promise.all([editorsPromise, selectedPromise]);
|
||||
return Promise.all([editorsPromise, selectedPromise]);
|
||||
}
|
||||
|
||||
function openEditor(editor) {
|
||||
|
@ -69,7 +69,7 @@ function togglePref(UI) {
|
||||
|
||||
Services.prefs.setBoolPref(PREF, false);
|
||||
|
||||
return promise.all([editorsPromise, selectedPromise]);
|
||||
return Promise.all([editorsPromise, selectedPromise]);
|
||||
}
|
||||
|
||||
function openEditor(editor) {
|
||||
|
Loading…
Reference in New Issue
Block a user