summaryrefslogtreecommitdiffstats
path: root/devtools/client/webconsole/test/browser/browser_webconsole_console_timeStamp.js
blob: 158e10b7a490f7137c7d50a3a770726f838a7809 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/ */

// Tests that a console.timeStamp() does not print anything in the console

"use strict";

const TEST_URI = "data:text/html,<!DOCTYPE html><meta charset=utf8>";

add_task(async function () {
  // We open the console and an empty tab, as we only want to evaluate something.
  const hud = await openNewTabAndConsole(TEST_URI);
  // We execute `console.timeStamp('test')` from the console input.
  execute(hud, "console.timeStamp('test')");
  info(`Checking size`);
  await waitFor(() => findAllMessages(hud).length == 2);
  const [first, second] = findAllMessages(hud).map(message =>
    message.textContent.trim()
  );
  info(`Checking first message`);
  is(first, "console.timeStamp('test')", "First message has expected text");
  info(`Checking second message`);
  is(second, "undefined", "Second message has expected text");
});