Bug 1387123 - Replace all usages of require(promise).defer by require(devtools/shared/defer).defer. r=tromey

In prevision of Promise.jsm removal, use defer helper module instead of Promise.jsm
as that's the only one feature that DOM Promise don't support.

PART2: Substitutes promise.defer usages with defer
$ sed -i 's/promise.defer/defer/gI' $(egrep -lir "promise.defer\(\)" devtools)
  Reset modification to the following files as they are using deprecated syncable promises as we don't want to touch them.
  http://searchfox.org/mozilla-central/search?q=deprecated-sync-thenables&case=true&regexp=false&path=
$ git checkout devtools/client/debugger/test/mochitest/
$ git checkout devtools/shared/client/main.js
$ git checkout devtools/client/debugger/
$ git checkout devtools/server/main.js

MozReview-Commit-ID: DGN5ae68wtn

--HG--
extra : rebase_source : 57602d89b0bcc1c905bee7723e30f87fa434c6d9
This commit is contained in:
Alexandre Poirot 2017-08-08 15:24:04 +02:00
Родитель 2bd76261bb
Коммит a8c68f2955
100 изменённых файлов: 188 добавлений и 188 удалений

Просмотреть файл

@ -79,7 +79,7 @@ function* ifTestingSupported() {
}
function waitForMozSetImageElement(panel) {
let deferred = promise.defer();
let deferred = defer();
panel._onMozSetImageElement = deferred.resolve;
return deferred.promise;
}

Просмотреть файл

@ -73,7 +73,7 @@ function loadFrameScripts() {
function addTab(aUrl, aWindow) {
info("Adding tab: " + aUrl);
let deferred = promise.defer();
let deferred = defer();
let targetWindow = aWindow || window;
let targetBrowser = targetWindow.gBrowser;
@ -93,7 +93,7 @@ function addTab(aUrl, aWindow) {
function removeTab(aTab, aWindow) {
info("Removing tab.");
let deferred = promise.defer();
let deferred = defer();
let targetWindow = aWindow || window;
let targetBrowser = targetWindow.gBrowser;
let tabContainer = targetBrowser.tabContainer;
@ -149,7 +149,7 @@ function isTestingSupported() {
function once(aTarget, aEventName, aUseCapture = false) {
info("Waiting for event: '" + aEventName + "' on " + aTarget + ".");
let deferred = promise.defer();
let deferred = defer();
for (let [add, remove] of [
["on", "off"], // Use event emitter before DOM events for consistency
@ -170,7 +170,7 @@ function once(aTarget, aEventName, aUseCapture = false) {
}
function waitForTick() {
let deferred = promise.defer();
let deferred = defer();
executeSoon(deferred.resolve);
return deferred.promise;
}
@ -257,7 +257,7 @@ function teardown({target}) {
* in potentially a different process.
*/
function evalInDebuggee(script) {
let deferred = promise.defer();
let deferred = defer();
if (!mm) {
throw new Error("`loadFrameScripts()` must be called when using MessageManager.");
@ -296,7 +296,7 @@ function* waitUntil(predicate, interval = 10) {
if (yield predicate()) {
return Promise.resolve(true);
}
let deferred = Promise.defer();
let deferred = defer();
setTimeout(function () {
waitUntil(predicate).then(() => deferred.resolve(true));
}, interval);

Просмотреть файл

@ -43,7 +43,7 @@ DomPanel.prototype = {
return this._opening;
}
let deferred = promise.defer();
let deferred = defer();
this._opening = deferred.promise;
// Local monitoring needs to make the target remote.
@ -83,7 +83,7 @@ DomPanel.prototype = {
return this._destroying;
}
let deferred = promise.defer();
let deferred = defer();
this._destroying = deferred.promise;
this.target.off("navigate", this.onTabNavigated);

Просмотреть файл

@ -35,7 +35,7 @@ registerCleanupFunction(() => {
function addJsonViewTab(url, timeout = -1) {
info("Adding a new JSON tab with URL: '" + url + "'");
let deferred = promise.defer();
let deferred = defer();
addTab(url).then(tab => {
let browser = tab.linkedBrowser;
@ -151,7 +151,7 @@ function sendString(str, selector) {
}
function waitForTime(delay) {
let deferred = promise.defer();
let deferred = defer();
setTimeout(deferred.resolve, delay);
return deferred.promise;
}

Просмотреть файл

@ -220,7 +220,7 @@ GraphsController.prototype = {
return;
}
this._rendering = promise.defer();
this._rendering = defer();
for (let graph of (yield this._getEnabled())) {
yield graph.setPerformanceData(recordingData, resolution);
this.emit("rendered", graph.graphName);

Просмотреть файл

@ -32,7 +32,7 @@ PerformancePanel.prototype = {
if (this._opening) {
return this._opening;
}
let deferred = promise.defer();
let deferred = defer();
this._opening = deferred.promise;
this.panelWin.gToolbox = this.toolbox;

Просмотреть файл

@ -536,7 +536,7 @@ var PerformanceController = {
* @return {Promise}
*/
waitForStateChangeOnRecording: Task.async(function* (recording, expectedState) {
let deferred = promise.defer();
let deferred = defer();
this.on(EVENTS.RECORDING_STATE_CHANGE, function handler(state, model) {
if (state === expectedState && model === recording) {
this.off(EVENTS.RECORDING_STATE_CHANGE, handler);

Просмотреть файл

@ -38,7 +38,7 @@ function getUnicodeConverter() {
}
function asyncCopy(data, file) {
let deferred = Promise.defer();
let deferred = defer();
let string = JSON.stringify(data);
let inputStream = getUnicodeConverter().convertToInputStream(string);

Просмотреть файл

@ -160,7 +160,7 @@ function getUnicodeConverter() {
}
function asyncCopy(data, file) {
let deferred = Promise.defer();
let deferred = defer();
let string = JSON.stringify(data);
let inputStream = getUnicodeConverter().convertToInputStream(string);

Просмотреть файл

@ -124,7 +124,7 @@ function getUnicodeConverter() {
}
function asyncCopy(data, file) {
let deferred = Promise.defer();
let deferred = defer();
let string = JSON.stringify(data);
let inputStream = getUnicodeConverter().convertToInputStream(string);

Просмотреть файл

@ -73,7 +73,7 @@ function testWorkerMarkerUI(node) {
*/
function evalInDebuggee(script) {
let { generateUUID } = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator);
let deferred = Promise.defer();
let deferred = defer();
if (!mm) {
throw new Error("`loadFrameScripts()` must be called when using MessageManager.");

Просмотреть файл

@ -20,7 +20,7 @@ function ScratchpadPanel(iframeWindow, toolbox) {
Scratchpad.target = this.target;
Scratchpad.hideMenu();
let deferred = promise.defer();
let deferred = defer();
this._readyObserver = deferred.promise;
Scratchpad.addObserver({
onReady: function () {

Просмотреть файл

@ -507,7 +507,7 @@ var Scratchpad = {
let evalOptions = { url: this.uniqueName };
return connection.then(({ debuggerClient, webConsoleClient }) => {
let deferred = promise.defer();
let deferred = defer();
webConsoleClient.evaluateJSAsync(aString, aResponse => {
this.debuggerClient = debuggerClient;
@ -550,7 +550,7 @@ var Scratchpad = {
*/
run: function SP_run()
{
let deferred = promise.defer();
let deferred = defer();
let reject = aReason => deferred.reject(aReason);
this.execute().then(([aString, aError, aResult]) => {
@ -577,7 +577,7 @@ var Scratchpad = {
*/
inspect: function SP_inspect()
{
let deferred = promise.defer();
let deferred = defer();
let reject = aReason => deferred.reject(aReason);
this.execute().then(([aString, aError, aResult]) => {
@ -605,7 +605,7 @@ var Scratchpad = {
*/
reloadAndRun: function SP_reloadAndRun()
{
let deferred = promise.defer();
let deferred = defer();
if (this.executionContext !== SCRATCHPAD_CONTEXT_CONTENT) {
console.error(this.strings.
@ -633,7 +633,7 @@ var Scratchpad = {
*/
display: function SP_display()
{
let deferred = promise.defer();
let deferred = defer();
let reject = aReason => deferred.reject(aReason);
this.execute().then(([aString, aError, aResult]) => {
@ -876,7 +876,7 @@ var Scratchpad = {
*/
_writePrimitiveAsComment: function SP__writePrimitiveAsComment(aValue)
{
let deferred = promise.defer();
let deferred = defer();
if (aValue.type == "longString") {
let client = this.webConsoleClient;
@ -935,7 +935,7 @@ var Scratchpad = {
*/
writeAsErrorComment: function SP_writeAsErrorComment(aError)
{
let deferred = promise.defer();
let deferred = defer();
if (VariablesView.isPrimitive({ value: aError.exception })) {
let error = aError.exception;
@ -2112,7 +2112,7 @@ ScratchpadTab.prototype = {
return this._connector;
}
let deferred = promise.defer();
let deferred = defer();
this._connector = deferred.promise;
let connectTimer = setTimeout(() => {
@ -2263,7 +2263,7 @@ ScratchpadSidebar.prototype = {
{
this.show();
let deferred = promise.defer();
let deferred = defer();
let onTabReady = () => {
if (this.variablesView) {

Просмотреть файл

@ -53,7 +53,7 @@ function runTests()
let browser = gBrowser.selectedBrowser;
let deferred = promise.defer();
let deferred = defer();
browser.addEventListener("DOMWindowCreated", function () {
browser.contentWindow.addEventListener("foo", function () {
is(browser.contentWindow.document.body.innerHTML, "Modified text",

Просмотреть файл

@ -154,7 +154,7 @@ function createTempFile(aName, aContent, aCallback = function () {})
*/
function runAsyncTests(aScratchpad, aTests)
{
let deferred = promise.defer();
let deferred = defer();
(function runTest() {
if (aTests.length) {

Просмотреть файл

@ -426,7 +426,7 @@ var ShadersEditorsView = {
return this._editorPromises.get(type);
}
let deferred = promise.defer();
let deferred = defer();
this._editorPromises.set(type, deferred.promise);
// Initialize the source editor and store the newly created instance

Просмотреть файл

@ -163,7 +163,7 @@ function getBlackBoxCheckbox(aPanel, aIndex) {
}
function once(aTarget, aEvent) {
let deferred = promise.defer();
let deferred = defer();
aTarget.once(aEvent, deferred.resolve);
return deferred.promise;
}

Просмотреть файл

@ -69,7 +69,7 @@ function loadFrameScripts() {
function addTab(aUrl, aWindow) {
info("Adding tab: " + aUrl);
let deferred = promise.defer();
let deferred = defer();
let targetWindow = aWindow || window;
let targetBrowser = targetWindow.gBrowser;
@ -88,7 +88,7 @@ function addTab(aUrl, aWindow) {
function removeTab(aTab, aWindow) {
info("Removing tab.");
let deferred = promise.defer();
let deferred = defer();
let targetWindow = aWindow || window;
let targetBrowser = targetWindow.gBrowser;
let tabContainer = targetBrowser.tabContainer;
@ -129,7 +129,7 @@ function createCanvas() {
function once(aTarget, aEventName, aUseCapture = false) {
info("Waiting for event: '" + aEventName + "' on " + aTarget + ".");
let deferred = promise.defer();
let deferred = defer();
for (let [add, remove] of [
["on", "off"], // Use event emitter before DOM events for consistency
@ -153,7 +153,7 @@ function once(aTarget, aEventName, aUseCapture = false) {
// array of all of the arguments in the handler. These should be consolidated
// into the same function, but many tests will need to be changed.
function onceSpread(aTarget, aEvent) {
let deferred = promise.defer();
let deferred = defer();
aTarget.once(aEvent, (...args) => deferred.resolve(args));
return deferred.promise;
}
@ -161,7 +161,7 @@ function onceSpread(aTarget, aEvent) {
function observe(aNotificationName, aOwnsWeak = false) {
info("Waiting for observer notification: '" + aNotificationName + ".");
let deferred = promise.defer();
let deferred = defer();
Services.obs.addObserver(function onNotification(...aArgs) {
Services.obs.removeObserver(onNotification, aNotificationName);
@ -277,7 +277,7 @@ function teardown(aPanel) {
// `onAdd` function that calls with the entire actors array on program link
function getPrograms(front, count, onAdd) {
let actors = [];
let deferred = promise.defer();
let deferred = defer();
front.on("program-linked", function onLink(actor) {
if (actors.length !== count) {
actors.push(actor);

Просмотреть файл

@ -1724,7 +1724,7 @@ Messages.ConsoleTable.prototype = extend(Messages.Extended.prototype, {
* null if the arguments are invalid.
*/
_populateTableData: function () {
let deferred = promise.defer();
let deferred = defer();
if (this._arguments.length <= 0) {
return deferred.reject();
@ -3176,7 +3176,7 @@ Widgets.ObjectRenderers.add({
let isAttached = yield this.toolbox.walker.isInDOMTree(this._nodeFront);
if (isAttached) {
let onReady = promise.defer();
let onReady = defer();
this.toolbox.inspector.once("inspector-updated", onReady.resolve);
yield this.toolbox.selection.setNodeFront(this._nodeFront, "console");
yield onReady.promise;

Просмотреть файл

@ -174,11 +174,11 @@ HUD_SERVICE.prototype =
return this._browserConsoleDefer.promise;
}
this._browserConsoleDefer = promise.defer();
this._browserConsoleDefer = defer();
function connect()
{
let deferred = promise.defer();
let deferred = defer();
if (!DebuggerServer.initialized) {
DebuggerServer.init();
@ -203,7 +203,7 @@ HUD_SERVICE.prototype =
function openWindow(aTarget)
{
target = aTarget;
let deferred = promise.defer();
let deferred = defer();
// Using the old frontend for now in the browser console. This can be switched to
// Tools.webConsole.url to use whatever is preffed on.
let url = Tools.webConsole.oldWebConsoleURL;
@ -558,7 +558,7 @@ WebConsole.prototype = {
HUDService.consoles.delete(this.hudId);
this._destroyer = promise.defer();
this._destroyer = defer();
// The document may already be removed
if (this.chromeUtilsWindow && this.mainPopupSet) {
@ -678,7 +678,7 @@ BrowserConsole.prototype = extend(WebConsole.prototype, {
this._telemetry.toolClosed("browserconsole");
this._bc_destroyer = promise.defer();
this._bc_destroyer = defer();
let chromeWindow = this.chromeWindow;
this.$destroy().then(() =>

Просмотреть файл

@ -434,7 +434,7 @@ JSTerm.prototype = {
* Resolves with the message once the result is displayed.
*/
execute: function (executeString, callback) {
let deferred = promise.defer();
let deferred = defer();
let resultCallback;
if (this.hud.NEW_CONSOLE_OUTPUT_ENABLED) {
resultCallback = (msg) => deferred.resolve(msg);
@ -523,7 +523,7 @@ JSTerm.prototype = {
* received.
*/
requestEvaluation: function (str, options = {}) {
let deferred = promise.defer();
let deferred = defer();
function onResult(response) {
if (!response.error) {
@ -627,7 +627,7 @@ JSTerm.prototype = {
let openPromise;
if (options.targetElement) {
let deferred = promise.defer();
let deferred = defer();
openPromise = deferred.promise;
let document = options.targetElement.ownerDocument;
let iframe = document.createElementNS(XHTML_NS, "iframe");
@ -672,7 +672,7 @@ JSTerm.prototype = {
* A promise object for the adding of the new tab.
*/
_addVariablesViewSidebarTab: function () {
let deferred = promise.defer();
let deferred = defer();
let onTabReady = () => {
let window = this.sidebar.getWindowForTab("variablesview");

Просмотреть файл

@ -29,7 +29,7 @@ var DataProvider = {
return p;
}
let deferred = promise.defer();
let deferred = defer();
let realMethodName = "get" + method.charAt(0).toUpperCase() +
method.slice(1);

Просмотреть файл

@ -46,7 +46,7 @@ WebConsolePanel.prototype = {
let iframe = parentDoc.getElementById("toolbox-panel-iframe-webconsole");
// Make sure the iframe content window is ready.
let deferredIframe = promise.defer();
let deferredIframe = defer();
let win, doc;
if ((win = iframe.contentWindow) &&
(doc = win.document) &&

Просмотреть файл

@ -77,7 +77,7 @@ add_task(function* () {
info("expected clipboard value: " + message.url);
let deferred = promise.defer();
let deferred = defer();
waitForClipboard((aData) => {
return aData.trim() == message.url;

Просмотреть файл

@ -23,9 +23,9 @@ add_task(function* () {
let hud = yield openConsole();
ok(hud, "Web Console opened");
let tabClosed = promise.defer();
let toolboxDestroyed = promise.defer();
let tabSelected = promise.defer();
let tabClosed = defer();
let toolboxDestroyed = defer();
let tabSelected = defer();
let target = TargetFactory.forTab(gBrowser.selectedTab);
let toolbox = gDevTools.getToolbox(target);
@ -59,7 +59,7 @@ add_task(function* () {
hud = yield HUDService.toggleBrowserConsole();
ok(hud, "Browser Console opened");
let deferred = promise.defer();
let deferred = defer();
Services.obs.addObserver(function onDestroy() {
Services.obs.removeObserver(onDestroy, "web-console-destroyed");

Просмотреть файл

@ -200,7 +200,7 @@ function* testCPOWInspection(hud) {
}
function waitForConsole() {
let deferred = promise.defer();
let deferred = defer();
Services.obs.addObserver(function observer(aSubject) {
Services.obs.removeObserver(observer, "web-console-created");

Просмотреть файл

@ -67,7 +67,7 @@ function test() {
let viewSource = browserconsole.viewSource;
let URL = null;
let clickPromise = promise.defer();
let clickPromise = defer();
browserconsole.viewSourceInDebugger = (sourceURL) => {
info("browserconsole.viewSourceInDebugger() was invoked: " + sourceURL);
URL = sourceURL;

Просмотреть файл

@ -117,7 +117,7 @@ add_task(function* () {
let clickable = consoleErrorMsg.clickableElements[0];
ok(clickable, "clickable object found for console.error");
let deferred = promise.defer();
let deferred = defer();
let onFetch = (aEvent, aVar) => {
// Skip the notification from console.dir variablesview-fetched.

Просмотреть файл

@ -50,7 +50,7 @@ add_task(function* testCopy() {
]
];
for (let [source, reference] of samples) {
let deferredResult = promise.defer();
let deferredResult = defer();
SimpleTest.waitForClipboard(
"" + reference,

Просмотреть файл

@ -35,7 +35,7 @@ add_task(function* () {
hud.setFilterState("exception", true);
// We need to let the console opening event loop to finish.
let deferred = promise.defer();
let deferred = defer();
executeSoon(() => closeConsole().then(() => deferred.resolve(null)));
yield deferred.promise;

Просмотреть файл

@ -32,7 +32,7 @@ function* getVariablesView(hud) {
deferred.resolve(vview._variablesView);
}
let deferred = promise.defer();
let deferred = defer();
// Filter out other messages to ensure ours stays visible.
hud.ui.filterBox.value = "browser_console_hide_jsterm_test";

Просмотреть файл

@ -73,7 +73,7 @@ function waitForThreadEvents(aPanel, aEventName, aEventRepeat = 1) {
info("Waiting for thread event: '" + aEventName + "' to fire: " +
aEventRepeat + " time(s).");
let deferred = promise.defer();
let deferred = defer();
let thread = aPanel.panelWin.gThreadClient;
let count = 0;

Просмотреть файл

@ -109,7 +109,7 @@ add_task(function* () {
});
function updateServerLoggingListener(hud) {
let deferred = promise.defer();
let deferred = defer();
hud.ui._updateServerLoggingListener(response => {
deferred.resolve(response);
});

Просмотреть файл

@ -36,7 +36,7 @@ function test() {
const hud = yield openConsole(tab);
const jsterm = hud.jsterm;
let deferred = promise.defer();
let deferred = defer();
jsterm.once("variablesview-fetched", (_, val) => deferred.resolve(val));
jsterm.execute("inspect(document.querySelectorAll('div'))");

Просмотреть файл

@ -83,7 +83,7 @@ function test() {
*/
function* testNotSorted(aObject) {
info("Testing " + aObject);
let deferred = promise.defer();
let deferred = defer();
jsterm.once("variablesview-fetched", (_, aVar) => deferred.resolve(aVar));
jsterm.execute("inspect(" + aObject + ")");
@ -109,7 +109,7 @@ function test() {
*/
function* testSorted(aObject) {
info("Testing " + aObject);
let deferred = promise.defer();
let deferred = defer();
jsterm.once("variablesview-fetched", (_, aVar) => deferred.resolve(aVar));
jsterm.execute("inspect(" + aObject + ")");

Просмотреть файл

@ -30,8 +30,8 @@ add_task(function* () {
let {DebuggerController} = panelWin;
let {activeThread} = DebuggerController;
let firstCall = promise.defer();
let frameAdded = promise.defer();
let firstCall = defer();
let frameAdded = defer();
executeSoon(() => {
info("Executing firstCall");
activeThread.addOneTimeListener("framesadded", () => {

Просмотреть файл

@ -50,7 +50,7 @@ add_task(function* () {
});
function loadDocument(browser) {
let deferred = promise.defer();
let deferred = defer();
browser.addEventListener("load", function () {
deferred.resolve();

Просмотреть файл

@ -79,7 +79,7 @@ add_task(function* () {
});
function execute(hud, str) {
let deferred = promise.defer();
let deferred = defer();
hud.jsterm.execute(str, deferred.resolve);
return deferred.promise;
}

Просмотреть файл

@ -34,7 +34,7 @@ add_task(function* () {
});
function execute(hud, str) {
let deferred = promise.defer();
let deferred = defer();
hud.jsterm.execute(str, deferred.resolve);
return deferred.promise;
}

Просмотреть файл

@ -31,7 +31,7 @@ add_task(function* () {
});
function testWarningNotPresent(hud) {
let deferred = promise.defer();
let deferred = defer();
is(hud.outputNode.textContent.indexOf("logging API"), -1,
"no warning displayed");
@ -60,7 +60,7 @@ function testWarningNotPresent(hud) {
function testWarningPresent(hud) {
info("wait for the warning to show");
let deferred = promise.defer();
let deferred = defer();
let warning = {
webconsole: hud,

Просмотреть файл

@ -52,7 +52,7 @@ add_task(function* () {
});
function pushPrefEnv() {
let deferred = promise.defer();
let deferred = defer();
let options = {"set":
[["security.mixed_content.block_active_content", false],
["security.mixed_content.block_display_content", false]

Просмотреть файл

@ -14,7 +14,7 @@ add_task(function* () {
yield loadTab(TEST_URI);
function* autocomplete(term) {
let deferred = promise.defer();
let deferred = defer();
jsterm.setInputValue(term);
jsterm.complete(jsterm.COMPLETE_HINT_ONLY, deferred.resolve);

Просмотреть файл

@ -21,7 +21,7 @@ add_task(function* () {
});
function consoleOpened(HUD) {
let deferred = promise.defer();
let deferred = defer();
let jsterm = HUD.jsterm;
let stringToCopy = "foobazbarBug642615";

Просмотреть файл

@ -56,7 +56,7 @@ add_task(function* () {
});
function pushPrefEnv() {
let deferred = promise.defer();
let deferred = defer();
let options = {
"set": [
["security.mixed_content.block_active_content", true],
@ -70,7 +70,7 @@ function pushPrefEnv() {
}
function mixedContentOverrideTest2(hud, browser) {
let deferred = promise.defer();
let deferred = defer();
let {gIdentityHandler} = browser.ownerGlobal;
ok(gIdentityHandler._identityBox.classList.contains("mixedActiveBlocked"),
"Mixed Active Content state appeared on identity box");

Просмотреть файл

@ -19,7 +19,7 @@ add_task(function* () {
});
function testClosingAfterCompletion(hud, browser) {
let deferred = promise.defer();
let deferred = defer();
let errorWhileClosing = false;
function errorListener() {

Просмотреть файл

@ -31,7 +31,7 @@ add_task(function* () {
});
var consoleOpened = Task.async(function* (hud) {
let deferred = promise.defer();
let deferred = defer();
HUD = hud;
info("web console opened");
@ -146,7 +146,7 @@ var consoleOpened = Task.async(function* (hud) {
});
function popupHideAfterTab() {
let deferred = promise.defer();
let deferred = defer();
// At this point the completion suggestion should be accepted.
ok(!popup.isOpen, "popup is not open");
@ -198,7 +198,7 @@ function popupHideAfterTab() {
}
function testReturnKey() {
let deferred = promise.defer();
let deferred = defer();
popup.once("popup-opened", function onShown() {
ok(popup.isOpen, "popup is open");
@ -250,7 +250,7 @@ function testReturnKey() {
}
function* dontShowArrayNumbers() {
let deferred = promise.defer();
let deferred = defer();
info("dontShowArrayNumbers");
yield ContentTask.spawn(gBrowser.selectedBrowser, {}, function* () {
@ -286,7 +286,7 @@ function* dontShowArrayNumbers() {
}
function testReturnWithNoSelection() {
let deferred = promise.defer();
let deferred = defer();
info("test pressing return with open popup, but no selection, see bug 873250");
@ -325,7 +325,7 @@ function popupHideAfterReturnWithNoSelection() {
function testCompletionInText() {
info("test that completion works inside text, see bug 812618");
let deferred = promise.defer();
let deferred = defer();
popup.once("popup-opened", function onShown() {
ok(popup.isOpen, "popup is open");

Просмотреть файл

@ -16,7 +16,7 @@ add_task(function* () {
});
function consoleOpened(HUD) {
let deferred = promise.defer();
let deferred = defer();
let items = [
{label: "item0", value: "value0"},

Просмотреть файл

@ -24,7 +24,7 @@ add_task(function* () {
function consoleOpened(hud) {
HUD = hud;
let deferred = promise.defer();
let deferred = defer();
// See bugs 574036, 586386 and 587617.
outputNode = HUD.outputNode;
@ -77,7 +77,7 @@ function consoleOpened(hud) {
// Test that the context menu "Copy" (which has a different code path) works
// properly as well.
function testContextMenuCopy() {
let deferred = promise.defer();
let deferred = defer();
let contextMenuId = HUD.ui.outputWrapper.getAttribute("context");
let contextMenu = HUD.ui.document.getElementById(contextMenuId);

Просмотреть файл

@ -21,7 +21,7 @@ add_task(function* () {
// Test for bug 588730: Adding a text node to an existing label element causes
// warnings
function testTextNodeInsertion(hud) {
let deferred = promise.defer();
let deferred = defer();
let outputNode = hud.outputNode;
let label = document.createElementNS(

Просмотреть файл

@ -23,7 +23,7 @@ add_task(function* () {
});
function consoleOpened(hud) {
let deferred = promise.defer();
let deferred = defer();
for (let i = 0; i < 200; i++) {
content.console.log("test message " + i);

Просмотреть файл

@ -10,7 +10,7 @@ const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"test/test-bug-599725-response-headers.sjs";
function performTest(request, hud) {
let deferred = promise.defer();
let deferred = defer();
let headers = null;

Просмотреть файл

@ -10,7 +10,7 @@ const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"test/test-bug-600183-charset.html";
function performTest(lastFinishedRequest, console) {
let deferred = promise.defer();
let deferred = defer();
ok(lastFinishedRequest, "charset test page was loaded and logged");
HUDService.lastFinishedRequest.callback = null;
@ -37,7 +37,7 @@ function performTest(lastFinishedRequest, console) {
}
function waitForRequest() {
let deferred = promise.defer();
let deferred = defer();
HUDService.lastFinishedRequest.callback = (req, console) => {
performTest(req, console).then(deferred.resolve);
};

Просмотреть файл

@ -37,7 +37,7 @@ add_task(function* () {
// scroll to the first node
outputNode.focus();
let scrolled = promise.defer();
let scrolled = defer();
scrollBox.onscroll = () => {
info("onscroll top " + scrollBox.scrollTop);
@ -66,7 +66,7 @@ add_task(function* () {
}],
});
scrolled = promise.defer();
scrolled = defer();
scrollBox.onscroll = () => {
if (scrollBox.scrollTop != 0) {
// Wait for scroll to stabilize at the top.
@ -86,7 +86,7 @@ add_task(function* () {
// scroll back to the bottom
outputNode.lastChild.focus();
scrolled = promise.defer();
scrolled = defer();
scrollBox.onscroll = () => {
if (scrollBox.scrollTop == 0) {
// Wait for scroll to bottom.
@ -104,7 +104,7 @@ add_task(function* () {
ContentTask.spawn(gBrowser.selectedBrowser, null,
"() => content.console.log('test message 151')");
scrolled = promise.defer();
scrolled = defer();
scrollBox.onscroll = () => {
if (scrollBox.scrollTop == oldScrollTop) {
// Wait for scroll to change.

Просмотреть файл

@ -18,7 +18,7 @@ add_task(function* () {
});
function* test$(HUD) {
let deferred = promise.defer();
let deferred = defer();
HUD.jsterm.clearOutput();
@ -32,7 +32,7 @@ function* test$(HUD) {
}
function test$$(HUD) {
let deferred = promise.defer();
let deferred = defer();
HUD.jsterm.clearOutput();

Просмотреть файл

@ -58,7 +58,7 @@ add_task(function* () {
});
function onConsoleOpen(hud) {
let deferred = promise.defer();
let deferred = defer();
let hudBox = hud.ui.rootElement;
@ -92,7 +92,7 @@ function onConsoleOpen(hud) {
function onConsoleReopen1(hud) {
info("testing after reopening once");
let deferred = promise.defer();
let deferred = defer();
let hudBox = hud.ui.rootElement;

Просмотреть файл

@ -26,7 +26,7 @@ add_task(function* () {
});
function consoleOpened(hud) {
let deferred = promise.defer();
let deferred = defer();
webConsoleClient = hud.ui.webConsoleClient;
HUDService.lastFinishedRequest.callback = (aHttpRequest) => {
@ -43,7 +43,7 @@ function consoleOpened(hud) {
}
function getHeaders() {
let deferred = promise.defer();
let deferred = defer();
HUDService.lastFinishedRequest.callback = null;
@ -64,7 +64,7 @@ function getHeaders() {
}
function getContent() {
let deferred = promise.defer();
let deferred = defer();
webConsoleClient.getResponseContent(lastFinishedRequests["301"].actor,
function (response) {

Просмотреть файл

@ -26,7 +26,7 @@ add_task(function* () {
});
function consoleOpened() {
let deferred = promise.defer();
let deferred = defer();
let jsterm = gHUD.jsterm;
let popup = jsterm.autocompletePopup;
@ -58,7 +58,7 @@ function consoleOpened() {
}
function autocompletePopupHidden() {
let deferred = promise.defer();
let deferred = defer();
let jsterm = gHUD.jsterm;
let popup = jsterm.autocompletePopup;
@ -80,7 +80,7 @@ function autocompletePopupHidden() {
}
function testPropertyPanel() {
let deferred = promise.defer();
let deferred = defer();
let jsterm = gHUD.jsterm;
jsterm.clearOutput();

Просмотреть файл

@ -17,7 +17,7 @@ add_task(function* () {
});
function consoleOpened(HUD) {
let deferred = promise.defer();
let deferred = defer();
let jsterm = HUD.jsterm;
let popup = jsterm.autocompletePopup;

Просмотреть файл

@ -89,7 +89,7 @@ function testOnNetActivity() {
}
function onNetworkMessage(results) {
let deferred = promise.defer();
let deferred = defer();
outputNode.focus();
let msg = [...results[0].matched][0];
@ -125,7 +125,7 @@ function onNetworkMessage(results) {
}
function testOnNetActivityContextMenu(msg) {
let deferred = promise.defer();
let deferred = defer();
outputNode.focus();
HUD.ui.output.selectMessage(msg);

Просмотреть файл

@ -22,7 +22,7 @@ add_task(function* () {
});
function testViewSource() {
let deferred = promise.defer();
let deferred = defer();
waitForMessages({
webconsole: hud,
@ -58,7 +58,7 @@ function testViewSource() {
}
function onStyleEditorReady(panel) {
let deferred = promise.defer();
let deferred = defer();
let win = panel.panelWindow;
ok(win, "Style Editor Window is defined");
@ -115,7 +115,7 @@ function checkStyleEditorForSheetAndLine(href, line) {
}
function performLineCheck(editor, line) {
let deferred = promise.defer();
let deferred = defer();
function checkForCorrectState() {
is(editor.sourceEditor.getCursor().line, line,

Просмотреть файл

@ -32,7 +32,7 @@ add_task(function* () {
});
function pushPrefEnv() {
let deferred = promise.defer();
let deferred = defer();
let options = {
set: [["security.mixed_content.block_active_content", true]]
};

Просмотреть файл

@ -26,7 +26,7 @@ function test() {
input.value = "docu";
input.setSelectionRange(4, 4);
let deferred = promise.defer();
let deferred = defer();
jsterm.complete(jsterm.COMPLETE_HINT_ONLY, function () {
is(jsterm.completeNode.value, " ment", "'docu' completion");

Просмотреть файл

@ -35,7 +35,7 @@ function test() {
loadTab(TEST_URI).then(() => {
openConsole().then((hud) => {
openDebugger().then(({ toolbox, panelWin }) => {
let deferred = promise.defer();
let deferred = defer();
fetchScopes(hud, toolbox, panelWin, deferred);
ContentTask.spawn(gBrowser.selectedBrowser, {}, function* () {

Просмотреть файл

@ -40,7 +40,7 @@ function test() {
let networkEventMessage = messages[0].matched.values().next().value;
let urlNode = networkEventMessage.querySelector(".url");
let deferred = promise.defer();
let deferred = defer();
urlNode.addEventListener("click", function (event) {
ok(event.defaultPrevented, "The default action was prevented.");

Просмотреть файл

@ -27,7 +27,7 @@ function testFilterButtons(aHud) {
}
function testRightClick(aCategory, hudBox, aHud) {
let deferred = promise.defer();
let deferred = defer();
let selector = ".webconsole-filter-button[category=\"" + aCategory + "\"]";
let button = hudBox.querySelector(selector);
let mainButton = getMainButton(button, aHud);

Просмотреть файл

@ -18,7 +18,7 @@ add_task(function* () {
});
function testForOf(hud) {
let deferred = promise.defer();
let deferred = defer();
let jsterm = hud.jsterm;
jsterm.execute("{ let _nodes = []; for (let x of document.body.childNodes) { if (x.nodeType === 1) { _nodes.push(x.tagName); } } _nodes.join(' '); }",

Просмотреть файл

@ -19,7 +19,7 @@ add_task(function* () {
});
function checkResult(msg, desc) {
let def = promise.defer();
let def = defer();
waitForMessages({
webconsole: jsterm.hud.owner,
messages: [{

Просмотреть файл

@ -88,7 +88,7 @@ function testMessages() {
}
function pushPrefEnv() {
let deferred = promise.defer();
let deferred = defer();
let options = {
set: [["devtools.webconsole.filter.networkinfo", true]]
};

Просмотреть файл

@ -11,7 +11,7 @@ const TEST_URI = "data:text/html;charset=utf-8,<p>Web Console test for " +
add_task(function* () {
yield loadTab(TEST_URI);
let consoleOpened = promise.defer();
let consoleOpened = defer();
let gotEvents = waitForEvents(consoleOpened.promise);
yield openConsole().then(() => {
consoleOpened.resolve();
@ -21,7 +21,7 @@ add_task(function* () {
});
function waitForEvents(onConsoleOpened) {
let deferred = promise.defer();
let deferred = defer();
function webConsoleCreated(id) {
Services.obs.removeObserver(observer, "web-console-created");

Просмотреть файл

@ -103,7 +103,7 @@ function* getWidgetAndMessage(result) {
}
function reloadPage() {
let def = promise.defer();
let def = defer();
gBrowser.selectedBrowser.addEventListener("load", function () {
def.resolve();
}, {capture: true, once: true});

Просмотреть файл

@ -12,7 +12,7 @@ var { Tools } = require("devtools/client/definitions");
var { isTargetSupported } = Tools.scratchpad;
function pushPrefEnv() {
let deferred = promise.defer();
let deferred = defer();
let options = {"set":
[["devtools.scratchpad.enabled", true]
]};

Просмотреть файл

@ -50,7 +50,7 @@ add_task(function* () {
});
function loadDocument(browser) {
let deferred = promise.defer();
let deferred = defer();
browser.addEventListener("load", function () {
deferred.resolve();

Просмотреть файл

@ -194,7 +194,7 @@ function test() {
});
function openPanel(toolId) {
let deferred = promise.defer();
let deferred = defer();
let target = TargetFactory.forTab(gBrowser.selectedTab);
gDevTools.showToolbox(target, toolId).then(function (box) {
toolbox = box;

Просмотреть файл

@ -78,7 +78,7 @@
}
function testHideAutoCompletePopupAfterEscape() {
let deferred = promise.defer();
let deferred = defer();
let popup = jsterm.autocompletePopup;
popup.once("popup-closed", () => {

Просмотреть файл

@ -187,7 +187,7 @@ function findLogEntry(str) {
* A promise that is resolved once the web console is open.
*/
var openConsole = function (tab) {
let webconsoleOpened = promise.defer();
let webconsoleOpened = defer();
let target = TargetFactory.forTab(tab || gBrowser.selectedTab);
gDevTools.showToolbox(target, "webconsole").then(toolbox => {
let hud = toolbox.getCurrentPanel().hud;
@ -346,7 +346,7 @@ waitForExplicitFinish();
* A Promise object that is resolved based on the validator function.
*/
function waitForSuccess(options) {
let deferred = promise.defer();
let deferred = defer();
let start = Date.now();
let timeout = options.timeout || 5000;
let {validator} = options;
@ -452,7 +452,7 @@ function findVariableViewProperties(view, rules, options) {
return promise.resolve(null);
}
let deferred = promise.defer();
let deferred = defer();
let expandOptions = {
rootVariable: view,
expandTo: rule.name,
@ -594,7 +594,7 @@ function isVariableViewPropertyIterator(prop, webConsole) {
return promise.resolve(true);
}
let deferred = promise.defer();
let deferred = defer();
variablesViewExpandTo({
rootVariable: prop,
@ -630,7 +630,7 @@ function variablesViewExpandTo(options) {
let root = options.rootVariable;
let expandTo = options.expandTo.split(".");
let jsterm = (options.webconsole || {}).jsterm;
let lastDeferred = promise.defer();
let lastDeferred = defer();
function fetch(prop) {
if (!prop.onexpand) {
@ -638,7 +638,7 @@ function variablesViewExpandTo(options) {
return promise.reject(prop);
}
let deferred = promise.defer();
let deferred = defer();
if (prop._fetched || !jsterm) {
executeSoon(function () {
@ -716,7 +716,7 @@ var updateVariablesViewProperty = Task.async(function* (options) {
throw new Error("options.field is incorrect");
}
let deferred = promise.defer();
let deferred = defer();
executeSoon(() => {
EventUtils.synthesizeKey("A", { accelKey: true }, view.window);
@ -762,7 +762,7 @@ function openDebugger(options = {}) {
options.tab = gBrowser.selectedTab;
}
let deferred = promise.defer();
let deferred = defer();
let target = TargetFactory.forTab(options.tab);
let toolbox = gDevTools.getToolbox(target);
@ -892,7 +892,7 @@ function waitForMessages(options) {
let rules = WebConsoleUtils.cloneObject(options.messages, true);
let rulesMatched = 0;
let listenerAdded = false;
let deferred = promise.defer();
let deferred = defer();
options.matchCondition = options.matchCondition || "all";
function checkText(rule, text) {
@ -1495,12 +1495,12 @@ function checkOutputForInputs(hud, inputTests) {
}
ok(body, "the message body");
let deferredVariablesView = promise.defer();
let deferredVariablesView = defer();
entry._onVariablesViewOpen = onVariablesViewOpen.bind(null, entry,
deferredVariablesView);
hud.jsterm.on("variablesview-open", entry._onVariablesViewOpen);
let deferredTab = promise.defer();
let deferredTab = defer();
entry._onTabOpen = onTabOpen.bind(null, entry, deferredTab);
container.addEventListener("TabOpen", entry._onTabOpen, true);
@ -1716,7 +1716,7 @@ function waitForFinishedRequest(predicate = () => true) {
function once(target, eventName, useCapture = false) {
info("Waiting for event: '" + eventName + "' on " + target + ".");
let deferred = promise.defer();
let deferred = defer();
for (let [add, remove] of [
["addEventListener", "removeEventListener"],
@ -1775,7 +1775,7 @@ function getSourceActor(sources, URL) {
* open the expected URL.
*/
function simulateMessageLinkClick(element, expectedLink) {
let deferred = promise.defer();
let deferred = defer();
// Invoke the click event and check if a new tab would
// open to the correct page.

Просмотреть файл

@ -406,7 +406,7 @@ WebConsoleFrame.prototype = {
return promise.resolve(null);
}
let deferred = promise.defer();
let deferred = defer();
let newValue = !!value;
let toSet = {
"NetworkMonitor.saveRequestAndResponseBodies": newValue,
@ -437,7 +437,7 @@ WebConsoleFrame.prototype = {
return promise.resolve(null);
}
let deferred = promise.defer();
let deferred = defer();
let toSet = {
"NetworkMonitor.throttleData": value,
};
@ -506,7 +506,7 @@ WebConsoleFrame.prototype = {
return this._initDefer.promise;
}
this._initDefer = promise.defer();
this._initDefer = defer();
this.proxy = new WebConsoleConnectionProxy(this, this.owner.target);
this.proxy.connect().then(() => {
@ -2711,7 +2711,7 @@ WebConsoleFrame.prototype = {
return this._destroyer.promise;
}
this._destroyer = promise.defer();
this._destroyer = defer();
let toolbox = gDevTools.getToolbox(this.owner.target);
if (toolbox) {

Просмотреть файл

@ -204,7 +204,7 @@ exports.CanvasActor = protocol.ActorClassWithSpec(canvasSpec, {
this._webGLPrimitiveCounter.resetCounts();
this._callWatcher.resumeRecording();
let deferred = this._currentAnimationFrameSnapshot = promise.defer();
let deferred = this._currentAnimationFrameSnapshot = defer();
return deferred.promise;
},

Просмотреть файл

@ -22,7 +22,7 @@ exports.DeviceActor = protocol.ActorClassWithSpec(deviceSpec, {
},
getWallpaper: function () {
let deferred = promise.defer();
let deferred = defer();
getSetting("wallpaper.image").then((blob) => {
let reader = new FileReader();
let conn = this.conn;

Просмотреть файл

@ -2751,7 +2751,7 @@ exports.InspectorActor = protocol.ActorClassWithSpec(inspectorSpec, {
return this._walkerPromise;
}
let deferred = promise.defer();
let deferred = defer();
this._walkerPromise = deferred.promise;
let window = this.window;

Просмотреть файл

@ -78,7 +78,7 @@ var storageTypePool = new Map();
* The wait time in milliseconds.
*/
function sleep(time) {
let deferred = promise.defer();
let deferred = defer();
setTimeout(() => {
deferred.resolve(null);
@ -1852,7 +1852,7 @@ StorageActors.createActor({
let unresolvedPromises = new Map();
function callParentProcessAsync(methodName, ...args) {
let deferred = promise.defer();
let deferred = defer();
unresolvedPromises.set(methodName, deferred);
@ -1925,7 +1925,7 @@ var indexedDBHelpers = {
*/
getDBMetaData: Task.async(function* (host, principal, name, storage) {
let request = this.openWithPrincipal(principal, name, storage);
let success = promise.defer();
let success = defer();
request.onsuccess = event => {
let db = event.target.result;
@ -2287,7 +2287,7 @@ var indexedDBHelpers = {
getObjectStoreData(host, principal, dbName, storage, requestOptions) {
let {name} = this.splitNameAndStorage(dbName);
let request = this.openWithPrincipal(principal, name, storage);
let success = promise.defer();
let success = defer();
let {objectStore, id, index, offset, size} = requestOptions;
let data = [];
let db;

Просмотреть файл

@ -320,7 +320,7 @@ var StyleSheetActor = protocol.ActorClassWithSpec(styleSheetSpec, {
return this._cssRules;
}
let deferred = promise.defer();
let deferred = defer();
let onSheetLoaded = (event) => {
this.ownerNode.removeEventListener("load", onSheetLoaded);
@ -547,7 +547,7 @@ var StyleSheetActor = protocol.ActorClassWithSpec(styleSheetSpec, {
* A promise that resolves with a SourceMapConsumer, or null.
*/
_fetchSourceMap: function () {
let deferred = promise.defer();
let deferred = defer();
this._getText().then(sheetContent => {
let url = this._extractSourceMapUrl(sheetContent);

Просмотреть файл

@ -743,7 +743,7 @@ BrowserTabActor.prototype = {
// so only request form update if some code is still listening on the other
// side.
if (!this.exited) {
this._deferredUpdate = promise.defer();
this._deferredUpdate = defer();
let onFormUpdate = msg => {
// There may be more than just one childtab.js up and running
if (this._form.actor != msg.json.actor) {
@ -830,7 +830,7 @@ function BrowserAddonList(connection) {
}
BrowserAddonList.prototype.getList = function () {
let deferred = promise.defer();
let deferred = defer();
AddonManager.getAllAddons((addons) => {
for (let addon of addons) {
let actor = this._actorByAddonId.get(addon.id);

Просмотреть файл

@ -259,7 +259,7 @@ exports.WebGLActor = protocol.ActorClassWithSpec(webGLSpec, {
* Used in tests.
*/
waitForFrame: function () {
let deferred = promise.defer();
let deferred = defer();
this.tabActor.window.requestAnimationFrame(deferred.resolve);
return deferred.promise;
},

Просмотреть файл

@ -732,7 +732,7 @@ var DebuggerServer = {
},
connectToContent(connection, mm, onDestroy) {
let deferred = SyncPromise.defer();
let deferred = Syncdefer();
let prefix = connection.allocID("content-process");
let actor, childTransport;
@ -1022,7 +1022,7 @@ var DebuggerServer = {
* established.
*/
connectToChild(connection, frame, onDestroy, {addonId} = {}) {
let deferred = SyncPromise.defer();
let deferred = Syncdefer();
// Get messageManager from XUL browser (which might be a specialized tunnel for RDM)
// or else fallback to asking the frameLoader itself.

Просмотреть файл

@ -90,7 +90,7 @@ function attachURL(url, callback) {
}
function promiseOnce(target, event) {
let deferred = promise.defer();
let deferred = defer();
target.on(event, (...args) => {
if (args.length === 1) {
deferred.resolve(args[0]);
@ -174,11 +174,11 @@ function assertOwnershipTrees(walker) {
// Verify that an actorID is inaccessible both from the client library and the server.
function checkMissing(client, actorID) {
let deferred = promise.defer();
let deferred = defer();
let front = client.getActor(actorID);
ok(!front, "Front shouldn't be accessible from the client for actorID: " + actorID);
deferred = promise.defer();
deferred = defer();
client.request({
to: actorID,
type: "request",
@ -191,11 +191,11 @@ function checkMissing(client, actorID) {
// Verify that an actorID is accessible both from the client library and the server.
function checkAvailable(client, actorID) {
let deferred = promise.defer();
let deferred = defer();
let front = client.getActor(actorID);
ok(front, "Front should be accessible from the client for actorID: " + actorID);
deferred = promise.defer();
deferred = defer();
client.request({
to: actorID,
type: "garbageAvailableTest",
@ -278,7 +278,7 @@ function assertChildList(mutations) {
// Load mutations aren't predictable, so keep accumulating mutations until
// the one we're looking for shows up.
function waitForMutation(walker, test, mutations = []) {
let deferred = promise.defer();
let deferred = defer();
for (let change of mutations) {
if (test(change)) {
deferred.resolve(mutations);

Просмотреть файл

@ -24,7 +24,7 @@ let gDoc = null;
addAsyncTest(function* () {
let url = document.getElementById("inspectorContent").href;
let def = promise.defer();
let def = defer();
attachURL(url, function (err, client, tab, doc) {
def.resolve({client, tab, doc});
});

Просмотреть файл

@ -822,7 +822,7 @@ function getSourceContent(sourceClient) {
* @returns Promise<SourceClient>
*/
function getSource(threadClient, url) {
let deferred = promise.defer();
let deferred = defer();
threadClient.getSources((res) => {
let source = res.sources.filter(function (s) {
return s.url === url;
@ -843,7 +843,7 @@ function getSource(threadClient, url) {
* @returns Promise<response>
*/
function reload(tabClient) {
let deferred = promise.defer();
let deferred = defer();
tabClient._reload({}, deferred.resolve);
return deferred.promise;
}

Просмотреть файл

@ -70,7 +70,7 @@ function setup_code() {
}
function black_box_code() {
const d = promise.defer();
const d = defer();
gThreadClient.getSources(function ({ sources, error }) {
do_check_true(!error, "Shouldn't get an error getting sources");
@ -89,7 +89,7 @@ function black_box_code() {
}
function run_code() {
const d = promise.defer();
const d = defer();
gClient.addOneTimeListener("paused", function (event, packet) {
d.resolve(packet);

Просмотреть файл

@ -149,7 +149,7 @@ function test_close_client_while_sending_requests() {
type: "hello"
});
let expectReply = promise.defer();
let expectReply = defer();
gClient.expectReply("root", function (response) {
do_check_eq(response.error, "connectionClosed");
do_check_eq(response.message,

Просмотреть файл

@ -30,7 +30,7 @@ function run_test() {
function test_nesting() {
const thread = gThreadActor;
const { resolve, promise: p } = promise.defer();
const { resolve, promise: p } = defer();
let currentStep = 0;

Просмотреть файл

@ -31,7 +31,7 @@ function run_test() {
function test_nesting() {
const thread = gThreadActor;
const { resolve, promise: p } = promise.defer();
const { resolve, promise: p } = defer();
// The following things should happen (in order):
// 1. In the new event loop (created by unsafeSynchronize)

Просмотреть файл

@ -57,7 +57,7 @@ add_task(function* () {
});
function getChromeActors() {
let deferred = promise.defer();
let deferred = defer();
get_chrome_actors((client, form) => deferred.resolve([client, form]));
return deferred.promise;
}

Просмотреть файл

@ -24,7 +24,7 @@ add_task(function* () {
// happen if the MOZ_PROFILER_STARTUP environment variable is set).
Profiler.StopProfiler();
let eventsCalled = 0;
let handledThreeTimes = promise.defer();
let handledThreeTimes = defer();
front.on("profiler-status", (response) => {
dump("'profiler-status' fired\n");
@ -67,7 +67,7 @@ add_task(function* () {
});
function getChromeActors() {
let deferred = promise.defer();
let deferred = defer();
get_chrome_actors((client, form) => deferred.resolve([client, form]));
return deferred.promise;
}

Просмотреть файл

@ -57,7 +57,7 @@ var RootActor = protocol.ActorClassWithSpec(rootSpec, {
promiseReturn: function (toWait) {
// Guarantee that this resolves after simpleReturn returns.
let deferred = promise.defer();
let deferred = defer();
let sequence = this.sequence++;
// Wait until the number of requests specified by toWait have
@ -80,7 +80,7 @@ var RootActor = protocol.ActorClassWithSpec(rootSpec, {
promiseThrow: function () {
// Guarantee that this resolves after simpleReturn returns.
let deferred = promise.defer();
let deferred = defer();
let sequence = this.sequence++;
// This should be enough to force a failure if the code is broken.
do_timeout(150, () => {
@ -148,7 +148,7 @@ function run_test() {
// While packets are sent in the correct order, rejection handlers
// registered in "Promise.jsm" may be invoked later than fulfillment
// handlers, meaning that we can't check the actual order with certainty.
let deferAfterRejection = promise.defer();
let deferAfterRejection = defer();
calls.push(rootClient.promiseThrow().then(() => {
do_check_true(false, "promiseThrow shouldn't succeed!");

Просмотреть файл

@ -165,7 +165,7 @@ function run_test() {
// That reference should be removed now.
expectRootChildren(0);
}).then(() => {
let deferred = promise.defer();
let deferred = defer();
rootClient.once("string-event", (str) => {
trace.expectSend({"type": "emitShortString", "to": "<actorid>"});
trace.expectReceive({"type": "string-event", "str": "abc", "from": "<actorid>"});
@ -187,7 +187,7 @@ function run_test() {
// Will generate no packets
return strfront.release();
}).then(() => {
let deferred = promise.defer();
let deferred = defer();
rootClient.once("string-event", (str) => {
trace.expectSend({"type": "emitLongString", "to": "<actorid>"});
trace.expectReceive({"type": "string-event",

Просмотреть файл

@ -300,7 +300,7 @@ function run_test() {
do_check_eq(str, "hello");
let deferred = promise.defer();
let deferred = defer();
rootClient.on("oneway", (response) => {
trace.expectSend({"type": "testOneWay", "a": "hello", "to": "<actorid>"});
trace.expectReceive({"type": "oneway", "a": "hello", "from": "<actorid>"});
@ -311,7 +311,7 @@ function run_test() {
do_check_true(typeof (rootClient.testOneWay("hello")) === "undefined");
return deferred.promise;
}).then(() => {
let deferred = promise.defer();
let deferred = defer();
rootClient.on("falsyOptions", res => {
trace.expectSend({"type": "emitFalsyOptions", "to": "<actorid>"});
trace.expectReceive({"type": "falsyOptions",

Просмотреть файл

@ -61,7 +61,7 @@ function define_code() {
}
function run_code() {
const d = promise.defer();
const d = defer();
gClient.addOneTimeListener("paused", function (event, packet) {
d.resolve(packet);
gThreadClient.resume();

Просмотреть файл

@ -61,7 +61,7 @@ function define_code() {
}
function run_code() {
const d = promise.defer();
const d = defer();
gClient.addOneTimeListener("paused", function () {
gThreadClient.getFrames(0, 3, function (response) {
d.resolve(response);

Просмотреть файл

@ -21,7 +21,7 @@ this.rpc = function (method, ...params) {
id: id
}));
let deferred = Promise.defer();
let deferred = defer();
rpcDeferreds[id] = deferred;
return deferred.promise;
};

Просмотреть файл

@ -43,7 +43,7 @@ TestStreamListener.prototype = {
onStateChanged: function () {
if (!this._deferred) {
this._deferred = promise.defer();
this._deferred = defer();
}
return this._deferred.promise;
}