Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

/* Any copyright is dedicated to the Public Domain.
// Test that hitting Ctrl + E does toggle the editor mode.
"use strict";
const TEST_URI =
"data:text/html;charset=utf-8,<!DOCTYPE html>Test concurrent top-level await expressions returning same value";
add_task(async function () {
// Enable editor mode as we'll be able to quicly trigger multiple evaluations.
await pushPref("devtools.webconsole.input.editor", true);
const hud = await openNewTabAndConsole(TEST_URI);
setInputValue(
hud,
`await new Promise(res => setTimeout(() => res("foo"), 5000))`
);
info("Evaluate the expression 3 times in a row");
const executeButton = hud.ui.outputNode.querySelector(
".webconsole-editor-toolbar-executeButton"
);
executeButton.click();
executeButton.click();
executeButton.click();
await waitFor(
() => findEvaluationResultMessages(hud, "foo").length === 3,
"Waiting for all results to be printed in console",
1000
);
ok(true, "There are as many results as commands");
Services.prefs.clearUserPref("devtools.webconsole.input.editor");
});