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

"use strict";

// Check that Console API works with iframes. See Bug 613013.

const TEST_URI =
  "http://example.com/browser/devtools/client/webconsole/" +
  "test/browser/test-console-api-iframe.html";

add_task(async function () {
  const hud = await openNewTabAndConsole(TEST_URI);
  const loggedString = "iframe added";
  // Wait for the initial message to be displayed.
  await waitFor(() => findConsoleAPIMessage(hud, loggedString));
  ok(true, "The initial message is displayed in the console");
  // Create a promise for the message logged after the reload.
  const onMessage = waitForMessageByType(hud, loggedString, ".console-api");
  BrowserCommands.reload();
  await onMessage;
  ok(true, "The message is also displayed after a page reload");
});