tor-browser

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

browser_webconsole_console_api_iframe.js (868B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 * http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 // Check that Console API works with iframes. See Bug 613013.
      7 
      8 const TEST_URI =
      9  "http://example.com/browser/devtools/client/webconsole/" +
     10  "test/browser/test-console-api-iframe.html";
     11 
     12 add_task(async function () {
     13  const hud = await openNewTabAndConsole(TEST_URI);
     14  const loggedString = "iframe added";
     15  // Wait for the initial message to be displayed.
     16  await waitFor(() => findConsoleAPIMessage(hud, loggedString));
     17  ok(true, "The initial message is displayed in the console");
     18  // Create a promise for the message logged after the reload.
     19  const onMessage = waitForMessageByType(hud, loggedString, ".console-api");
     20  BrowserCommands.reload();
     21  await onMessage;
     22  ok(true, "The message is also displayed after a page reload");
     23 });