tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

browser_webconsole_console_timeStamp.js (940B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 * http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 // Tests that a console.timeStamp() does not print anything in the console
      5 
      6 "use strict";
      7 
      8 const TEST_URI = "data:text/html,<!DOCTYPE html><meta charset=utf8>";
      9 
     10 add_task(async function () {
     11  // We open the console and an empty tab, as we only want to evaluate something.
     12  const hud = await openNewTabAndConsole(TEST_URI);
     13  // We execute `console.timeStamp('test')` from the console input.
     14  execute(hud, "console.timeStamp('test')");
     15  info(`Checking size`);
     16  await waitFor(() => findAllMessages(hud).length == 2);
     17  const [first, second] = findAllMessages(hud).map(message =>
     18    message.textContent.trim()
     19  );
     20  info(`Checking first message`);
     21  is(first, "console.timeStamp('test')", "First message has expected text");
     22  info(`Checking second message`);
     23  is(second, "undefined", "Second message has expected text");
     24 });