Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: asan
- Manifest: devtools/client/webconsole/test/browser/_webconsole.toml
/* Any copyright is dedicated to the Public Domain.
// Check if an error with a stack containing grouped frames works as expected.
"use strict";
const MESSAGE = "React Error";
const TEST_URI = `data:text/html;charset=utf8,<!DOCTYPE html><script>
const x = new Error("${MESSAGE}");
console.error(x);
</script>`;
add_task(async function () {
const hud = await openNewTabAndConsole(TEST_URI);
info("Wait for the error to be logged");
const msgNode = await waitFor(() => findConsoleAPIMessage(hud, MESSAGE));
ok(!msgNode.classList.contains("open"), `Error logged not expanded`);
const groupNode = await waitFor(() => msgNode.querySelector(".group"));
ok(groupNode, "The error object is logged as expected");
const onGroupExpanded = waitFor(() =>
msgNode.querySelector(".frames-group.expanded")
);
groupNode.click();
await onGroupExpanded;
ok(true, "The stacktrace group was expanded");
is(
msgNode.querySelectorAll(".frame").length,
3,
"Expected frames are displayed"
);
ok(
!msgNode.classList.contains("open"),
`Error message is still not expanded`
);
});