Skip to content
Snippets Groups Projects
Commit 3d1a54dc authored by Emilio Cobos Álvarez's avatar Emilio Cobos Álvarez
Browse files

Bug 1835066 - Tweak test_parser_diagnostics_unprintables.html to keep testing...

Bug 1835066 - Tweak test_parser_diagnostics_unprintables.html to keep testing unexpected token errors. r=dholbert

Without nesting, the parser error is the unexpected token error, emitted
from cssparser.

With nesting enabled these behave the same as other strings outside of a
block (so an "unexpected end of input" error instead).

Tweak the test a bit to keep testing what this test wants to test (that
unexpected token errors are escaped).

Differential Revision: https://phabricator.services.mozilla.com/D179830
parent 882ddb97
No related branches found
No related tags found
No related merge requests found
......@@ -39,11 +39,11 @@ let patterns = [
// _Dimension
{ i: "@namespace fnord 14<t>;", o: "within @namespace: \u201814<i>\u2019" },
// _AtKeyword
{ i: "x{@<t>: }", o: "declaration but found \u2018@<i>\u2019." },
{ i: "x{@<t>: }", o: "declaration but found \u2018@<i>\u2019." },
// _String
{ i: "x{ '<t>'}" , o: 'declaration but found \u2018"<s>"\u2019.' },
{ i: "x{ color: '<t>'}" , o: 'color but found \u2018"<s>"\u2019.' },
// _Bad_String
{ i: "x{ '<t>\n}", o: 'declaration but found \u2018"<s>\u2019.' },
{ i: "x{ color: '<t>\n}", o: 'color but found \u2018"<s>\u2019.' },
];
// Blocks of characters to test, and how they should be escaped when
......@@ -206,6 +206,8 @@ function nextTest() {
let css = subst(patterns[curpat].i, substitutions[cursubst]);
let msg = quotemeta(subst(patterns[curpat].o, substitutions[cursubst]));
info(css);
info(msg);
SimpleTest.expectConsoleMessages(function () { testbench.innerHTML = css },
[{ errorMessage: new RegExp(msg) }],
nextTest);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment