Commit bb8fe8b0 authored by Nicolas Chevobbe's avatar Nicolas Chevobbe
Browse files

Bug 1824675 - [devtools] Properly wait for console to reload in DAMP test....

Bug 1824675 - [devtools] Properly wait for console to reload in DAMP test. r=devtools-reviewers,perftest-reviewers,ochameau,sparky

Differential Revision: https://phabricator.services.mozilla.com/D173796
parent 2aac9775
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -21,9 +21,10 @@ const {
 *          - {Boolean} stacktrace: If true, wait for a stacktrace element to be rendered.
 */
exports.reloadConsoleAndLog = async function(label, toolbox, expectedMessages) {
  const webConsole = toolbox.getPanel("webconsole");
  const onWebConsoleReload = webConsole.once("reloaded");
  const onReload = async function() {
    const { hud } = toolbox.getPanel("webconsole");

    const { hud } = webConsole;
    const expected =
      typeof expectedMessages === "number"
        ? [{ text: "", count: expectedMessages }]
@@ -31,6 +32,10 @@ exports.reloadConsoleAndLog = async function(label, toolbox, expectedMessages) {

    let logMissingMessagesTimeoutId;

    // Wait for webconsole panel reload in order to prevent matching messages from previous
    // page load in the code below.
    await onWebConsoleReload;

    await waitForConsoleOutputChildListChange(hud, consoleOutputEl => {
      if (logMissingMessagesTimeoutId) {
        clearTimeout(logMissingMessagesTimeoutId);