From 1bfac542751fbb4846d7c3455a6614d30151f9c6 Mon Sep 17 00:00:00 2001 From: Ronald Brill Date: Tue, 4 Feb 2025 08:58:50 +0100 Subject: [PATCH] build the correct error (NYI) --- .../org/htmlunit/javascript/ErrorTest.java | 182 ++++++++++++++++++ 1 file changed, 182 insertions(+) diff --git a/src/test/java/org/htmlunit/javascript/ErrorTest.java b/src/test/java/org/htmlunit/javascript/ErrorTest.java index 4f45657a09..9f418dae06 100644 --- a/src/test/java/org/htmlunit/javascript/ErrorTest.java +++ b/src/test/java/org/htmlunit/javascript/ErrorTest.java @@ -17,6 +17,7 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserRunner; import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; import org.junit.Test; import org.junit.runner.RunWith; @@ -36,6 +37,14 @@ public class ErrorTest extends WebDriverTestCase { "undefined", "true", "Error/Error"}, FF = {"Error", "Whoops!", "undefined", "11", "undefined", "25", "true", "Error/Error"}, FF_ESR = {"Error", "Whoops!", "undefined", "11", "undefined", "25", "true", "Error/Error"}) + @HtmlUnitNYI(CHROME = {"Error", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "Error/Error"}, + EDGE = {"Error", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "Error/Error"}, + FF = {"Error", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "Error/Error"}, + FF_ESR = {"Error", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "Error/Error"}) public void error() throws Exception { final String html = "\n" @@ -72,6 +81,14 @@ public void error() throws Exception { "true", "true", "EvalError"}, FF_ESR = {"EvalError", "Whoops!", "undefined", "11", "undefined", "25", "true", "true", "EvalError"}) + @HtmlUnitNYI(CHROME = {"EvalError", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "true", "EvalError"}, + EDGE = {"EvalError", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "true", "EvalError"}, + FF = {"EvalError", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "true", "EvalError"}, + FF_ESR = {"EvalError", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "true", "EvalError"}) public void evalError() throws Exception { final String html = "\n" @@ -109,6 +126,14 @@ public void evalError() throws Exception { "true", "true", "RangeError"}, FF_ESR = {"RangeError", "Whoops!", "undefined", "11", "undefined", "25", "true", "true", "RangeError"}) + @HtmlUnitNYI(CHROME = {"RangeError", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "true", "RangeError"}, + EDGE = {"RangeError", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "true", "RangeError"}, + FF = {"RangeError", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "true", "RangeError"}, + FF_ESR = {"RangeError", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "true", "RangeError"}) public void rangeError() throws Exception { final String html = "\n" @@ -146,6 +171,14 @@ public void rangeError() throws Exception { "true", "true", "ReferenceError"}, FF_ESR = {"ReferenceError", "Whoops!", "undefined", "11", "undefined", "25", "true", "true", "ReferenceError"}) + @HtmlUnitNYI(CHROME = {"ReferenceError", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "true", "ReferenceError"}, + EDGE = {"ReferenceError", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "true", "ReferenceError"}, + FF = {"ReferenceError", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "true", "ReferenceError"}, + FF_ESR = {"ReferenceError", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "true", "ReferenceError"}) public void referenceError() throws Exception { final String html = "\n" @@ -183,6 +216,14 @@ public void referenceError() throws Exception { "true", "true", "SyntaxError"}, FF_ESR = {"SyntaxError", "Whoops!", "undefined", "11", "undefined", "25", "true", "true", "SyntaxError"}) + @HtmlUnitNYI(CHROME = {"SyntaxError", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "true", "SyntaxError"}, + EDGE = {"SyntaxError", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "true", "SyntaxError"}, + FF = {"SyntaxError", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "true", "SyntaxError"}, + FF_ESR = {"SyntaxError", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "true", "SyntaxError"}) public void syntaxError() throws Exception { final String html = "\n" @@ -220,6 +261,14 @@ public void syntaxError() throws Exception { "true", "true", "TypeError"}, FF_ESR = {"TypeError", "Whoops!", "undefined", "11", "undefined", "25", "true", "true", "TypeError"}) + @HtmlUnitNYI(CHROME = {"TypeError", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "true", "TypeError"}, + EDGE = {"TypeError", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "true", "TypeError"}, + FF = {"TypeError", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "true", "TypeError"}, + FF_ESR = {"TypeError", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "true", "TypeError"}) public void typeError() throws Exception { final String html = "\n" @@ -257,6 +306,14 @@ public void typeError() throws Exception { "true", "true", "URIError"}, FF_ESR = {"URIError", "Whoops!", "undefined", "11", "undefined", "25", "true", "true", "URIError"}) + @HtmlUnitNYI(CHROME = {"URIError", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "true", "URIError"}, + EDGE = {"URIError", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "true", "URIError"}, + FF = {"URIError", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "true", "URIError"}, + FF_ESR = {"URIError", "Whoops!", "undefined", "undefined", "undefined", + "25", "true", "true", "URIError"}) public void uriError() throws Exception { final String html = "\n" @@ -297,6 +354,18 @@ public void uriError() throws Exception { FF_ESR = {"AggregateError", "Whoops!", "undefined", "Error: some error", "11", "undefined", "25", "true", "true", "AggregateError/AggregateError"}) + @HtmlUnitNYI(CHROME = {"AggregateError", "Whoops!", "undefined", "Error: some error", + "undefined", "undefined", + "25", "true", "true", "AggregateError/AggregateError"}, + EDGE = {"AggregateError", "Whoops!", "undefined", "Error: some error", + "undefined", "undefined", + "25", "true", "true", "AggregateError/AggregateError"}, + FF = {"AggregateError", "Whoops!", "undefined", "Error: some error", + "undefined", "undefined", + "25", "true", "true", "AggregateError/AggregateError"}, + FF_ESR = {"AggregateError", "Whoops!", "undefined", "Error: some error", + "undefined", "undefined", + "25", "true", "true", "AggregateError/AggregateError"}) public void aggregateError() throws Exception { final String html = "\n" @@ -336,6 +405,14 @@ public void aggregateError() throws Exception { "true", "true", "InternalError/InternalError"}, FF_ESR = {"InternalError", "Whoops!", "undefined", "11", "undefined", "25", "true", "true", "InternalError/InternalError"}) + @HtmlUnitNYI(CHROME = {"InternalError", "Whoops!", "undefined", "undefined", "undefined", "25", + "true", "true", "InternalError/InternalError"}, + EDGE = {"InternalError", "Whoops!", "undefined", "undefined", "undefined", "25", + "true", "true", "InternalError/InternalError"}, + FF = {"InternalError", "Whoops!", "undefined", "undefined", "undefined", "25", + "true", "true", "InternalError/InternalError"}, + FF_ESR = {"InternalError", "Whoops!", "undefined", "undefined", "undefined", "25", + "true", "true", "InternalError/InternalError"}) public void internalError() throws Exception { final String html = "\n" @@ -362,4 +439,109 @@ public void internalError() throws Exception { loadPageVerifyTitle2(html); } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {"Error", "", "undefined", "undefined", "undefined", "undefined"}, + FF = {"Error", "", "undefined", "11", "undefined", "25"}, + FF_ESR = {"Error", "", "undefined", "11", "undefined", "25"}) + @HtmlUnitNYI(CHROME = {"Error", "", "undefined", "undefined", "undefined", "25"}, + EDGE = {"Error", "", "undefined", "undefined", "undefined", "25"}, + FF = {"Error", "", "undefined", "undefined", "undefined", "25"}, + FF_ESR = {"Error", "", "undefined", "undefined", "undefined", "25"}) + public void ctorWithoutParams() throws Exception { + final String html + = "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + ""; + + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {"Error", "msg", "undefined", "undefined", "undefined", "undefined"}, + FF = {"Error", "msg", "undefined", "11", "undefined", "25"}, + FF_ESR = {"Error", "msg", "undefined", "11", "undefined", "25"}) + @HtmlUnitNYI(CHROME = {"Error", "msg", "undefined", "undefined", "undefined", "25"}, + EDGE = {"Error", "msg", "undefined", "undefined", "undefined", "25"}, + FF = {"Error", "msg", "undefined", "undefined", "undefined", "25"}, + FF_ESR = {"Error", "msg", "undefined", "undefined", "undefined", "25"}) + public void ctorFilename() throws Exception { + final String html + = "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + ""; + + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(DEFAULT = {"Error", "test", "undefined", "undefined", "undefined", "undefined"}, + FF = {"Error", "test", "undefined", "11", "undefined", "25"}, + FF_ESR = {"Error", "test", "undefined", "11", "undefined", "25"}) + @HtmlUnitNYI(CHROME = {"Error", "test", "undefined", "undefined", "undefined", "25"}, + EDGE = {"Error", "test", "undefined", "undefined", "undefined", "25"}, + FF = {"Error", "test", "undefined", "undefined", "undefined", "25"}, + FF_ESR = {"Error", "test", "undefined", "undefined", "undefined", "25"}) + public void ctorAsFunction() throws Exception { + final String html + = "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + ""; + + loadPageVerifyTitle2(html); + } }