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.
// Ensure that same-origin errors are logged to the console.
// XPCNativeWrapper is not defined globally in ESLint as it may be going away.
/* global XPCNativeWrapper */
"use strict";
const TEST_URI =
"http://example.com/browser/devtools/client/webconsole/test/browser/test-checkloaduri-failure.html";
add_task(async function () {
const hud = await openNewTabAndConsole(TEST_URI);
const onErrorMessage = waitForMessageByType(
hud,
"may not load or link",
".error"
);
SpecialPowers.spawn(gBrowser.selectedBrowser, [targetURL], url => {
XPCNativeWrapper.unwrap(content).testImage(url);
});
const message = await onErrorMessage;
const node = message.node;
ok(
node.classList.contains("error"),
"The message has the expected classname"
);
ok(
node.textContent.includes(targetURL),
"The message is about the thing we were expecting"
);
});