/* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ // Tests that the console doesn't trigger any function in the page when logging the message "use strict"; const TEST_URI = `data:text/html,`; add_task(async function () { await addTab(TEST_URI); info("Open the console"); const hud = await openConsole(); // Only log messages *after* the console is opened as it may not trigger the same codepath for cached messages await SpecialPowers.spawn(gBrowser.selectedBrowser, [], () => { content.wrappedJSObject.logMessages(); }); const dateMessage = await waitFor(() => findConsoleAPIMessage(hud, "date")); Assert.stringContains(dateMessage.textContent, "Jan 01 2024"); const regExpMessage = await waitFor(() => findConsoleAPIMessage(hud, "regexp") ); Assert.stringContains(regExpMessage.textContent, "/foo/m"); await closeTabAndToolbox(); });