1
0
Fork 0
firefox/dom/base/test/test_reportPatternFailure.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

40 lines
1.1 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Test console error for invalid pattern attributes</title>
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1862199"/>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none">
<input pattern="[a]" id="inp">
</div>
<pre id="test">
<script>
SimpleTest.waitForExplicitFinish();
function runTest() {
// should find exactly one error
SimpleTest.monitorConsole(SimpleTest.finish, [
{ errorMessage: new RegExp(
"Unable to check <input pattern=\\[a-\\]> because /\\[a-\\]/v is not a valid regexp"
) }
], /*forbidUnexpectedMsgs*/ true);
let inp = document.getElementById("inp");
// should cause no error
inp.value = "a";
// should cause one error
inp.pattern = "[a-]";
SimpleTest.endMonitorConsole();
}
runTest();
</script>
</pre>
</body>
</html>