Skip to content

Commit

Permalink
more details for errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rbri committed Feb 3, 2025
1 parent bfc43f9 commit dedf6ff
Show file tree
Hide file tree
Showing 49 changed files with 210 additions and 205 deletions.
24 changes: 12 additions & 12 deletions src/test/java/org/htmlunit/general/ElementOwnPropertiesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14969,10 +14969,10 @@ public void pointerEvent() throws Exception {
* @throws Exception if the test fails
*/
@Test
@Alerts(CHROME = "NotSupportedError",
EDGE = "NotSupportedError",
FF = "NotSupportedError",
FF_ESR = "NotSupportedError")
@Alerts(CHROME = "NotSupportedError/DOMException",
EDGE = "NotSupportedError/DOMException",
FF = "NotSupportedError/DOMException",
FF_ESR = "NotSupportedError/DOMException")
public void pointerEvent2() throws Exception {
testString("", " document.createEvent('PointerEvent')");
}
Expand Down Expand Up @@ -15107,10 +15107,10 @@ public void inputEvent() throws Exception {
* @throws Exception if the test fails
*/
@Test
@Alerts(CHROME = "NotSupportedError",
EDGE = "NotSupportedError",
FF = "NotSupportedError",
FF_ESR = "NotSupportedError")
@Alerts(CHROME = "NotSupportedError/DOMException",
EDGE = "NotSupportedError/DOMException",
FF = "NotSupportedError/DOMException",
FF_ESR = "NotSupportedError/DOMException")
public void mouseWheelEvent() throws Exception {
testString("", "document.createEvent('MouseWheelEvent')");
}
Expand All @@ -15121,7 +15121,7 @@ public void mouseWheelEvent() throws Exception {
* @throws Exception if the test fails
*/
@Test
@Alerts("NotSupportedError")
@Alerts("NotSupportedError/DOMException")
public void svgZoomEvent() throws Exception {
testString("", "document.createEvent('SVGZoomEvent')");
}
Expand Down Expand Up @@ -15910,8 +15910,8 @@ public void gamepadEvent() throws Exception {
* @throws Exception if the test fails
*/
@Test
@Alerts(CHROME = "NotSupportedError",
EDGE = "NotSupportedError",
@Alerts(CHROME = "NotSupportedError/DOMException",
EDGE = "NotSupportedError/DOMException",
FF = "ADDITION[E],attrChange[GCE],attrName[GCE],constructor(),initMutationEvent(),MODIFICATION[E],"
+ "newValue[GCE],prevValue[GCE],relatedNode[GCE],"
+ "REMOVAL[E]",
Expand All @@ -15930,7 +15930,7 @@ public void mutationEvent() throws Exception {
* @throws Exception if the test fails
*/
@Test
@Alerts("NotSupportedError")
@Alerts("NotSupportedError/DOMException")
public void offlineAudioCompletionEvent() throws Exception {
testString("", "document.createEvent('OfflineAudioCompletionEvent')");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2257,7 +2257,7 @@ public void pointerEvent() throws Exception {
* @throws Exception if the test fails
*/
@Test
@Alerts("NotSupportedError")
@Alerts("NotSupportedError/DOMException")
public void pointerEvent2() throws Exception {
testString("", " document.createEvent('PointerEvent')");
}
Expand Down Expand Up @@ -2327,7 +2327,7 @@ public void inputEvent() throws Exception {
* @throws Exception if the test fails
*/
@Test
@Alerts("NotSupportedError")
@Alerts("NotSupportedError/DOMException")
public void mouseWheelEvent() throws Exception {
testString("", "document.createEvent('MouseWheelEvent')");
}
Expand All @@ -2338,7 +2338,7 @@ public void mouseWheelEvent() throws Exception {
* @throws Exception if the test fails
*/
@Test
@Alerts("NotSupportedError")
@Alerts("NotSupportedError/DOMException")
public void svgZoomEvent() throws Exception {
testString("", "document.createEvent('SVGZoomEvent')");
}
Expand Down Expand Up @@ -2586,7 +2586,7 @@ public void gamepadEvent() throws Exception {
* @throws Exception if the test fails
*/
@Test
@Alerts(DEFAULT = "NotSupportedError",
@Alerts(DEFAULT = "NotSupportedError/DOMException",
FF = "Symbol(Symbol.toStringTag) [C] [MutationEvent]",
FF_ESR = "Symbol(Symbol.toStringTag) [C] [MutationEvent]")
public void mutationEvent() throws Exception {
Expand All @@ -2599,7 +2599,7 @@ public void mutationEvent() throws Exception {
* @throws Exception if the test fails
*/
@Test
@Alerts("NotSupportedError")
@Alerts("NotSupportedError/DOMException")
public void offlineAudioCompletionEvent() throws Exception {
testString("", "document.createEvent('OfflineAudioCompletionEvent')");
}
Expand Down
24 changes: 12 additions & 12 deletions src/test/java/org/htmlunit/general/ElementPropertiesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3819,10 +3819,10 @@ public void pointerEvent() throws Exception {
* @throws Exception if the test fails
*/
@Test
@Alerts(CHROME = "NotSupportedError",
EDGE = "NotSupportedError",
FF = "NotSupportedError",
FF_ESR = "NotSupportedError")
@Alerts(CHROME = "NotSupportedError/DOMException",
EDGE = "NotSupportedError/DOMException",
FF = "NotSupportedError/DOMException",
FF_ESR = "NotSupportedError/DOMException")
public void pointerEvent2() throws Exception {
testString("", " document.createEvent('PointerEvent'), document.createEvent('MouseEvent')");
}
Expand Down Expand Up @@ -4082,10 +4082,10 @@ public void inputEvent() throws Exception {
* @throws Exception if the test fails
*/
@Test
@Alerts(CHROME = "NotSupportedError",
EDGE = "NotSupportedError",
FF = "NotSupportedError",
FF_ESR = "NotSupportedError")
@Alerts(CHROME = "NotSupportedError/DOMException",
EDGE = "NotSupportedError/DOMException",
FF = "NotSupportedError/DOMException",
FF_ESR = "NotSupportedError/DOMException")
public void mouseWheelEvent() throws Exception {
testString("", "document.createEvent('MouseWheelEvent')");
}
Expand All @@ -4096,7 +4096,7 @@ public void mouseWheelEvent() throws Exception {
* @throws Exception if the test fails
*/
@Test
@Alerts("NotSupportedError")
@Alerts("NotSupportedError/DOMException")
public void svgZoomEvent() throws Exception {
testString("", "document.createEvent('SVGZoomEvent')");
}
Expand Down Expand Up @@ -5908,8 +5908,8 @@ public void gamepadEvent() throws Exception {
* @throws Exception if the test fails
*/
@Test
@Alerts(CHROME = "NotSupportedError",
EDGE = "NotSupportedError",
@Alerts(CHROME = "NotSupportedError/DOMException",
EDGE = "NotSupportedError/DOMException",
FF = "ADDITION,ALT_MASK,AT_TARGET,attrChange,attrName,bubbles,BUBBLING_PHASE,cancelable,cancelBubble,"
+ "CAPTURING_PHASE,composed,composedPath(),CONTROL_MASK,currentTarget,defaultPrevented,eventPhase,"
+ "explicitOriginalTarget,initEvent(),initMutationEvent(),isTrusted,META_MASK,MODIFICATION,newValue,"
Expand Down Expand Up @@ -5938,7 +5938,7 @@ public void mutationEvent() throws Exception {
* @throws Exception if the test fails
*/
@Test
@Alerts("NotSupportedError")
@Alerts("NotSupportedError/DOMException")
public void offlineAudioCompletionEvent() throws Exception {
testString("", "document.createEvent('OfflineAudioCompletionEvent')");
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/htmlunit/html/DomNode2Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class DomNode2Test extends WebDriverTestCase {
* @throws Exception on test failure
*/
@Test
@Alerts({"HierarchyRequestError", "0"})
@Alerts({"HierarchyRequestError/DOMException", "0"})
public void appendChild_recursive() throws Exception {
final String html = "<html><head>\n"
+ "<script>\n"
Expand All @@ -61,7 +61,7 @@ public void appendChild_recursive() throws Exception {
* @throws Exception on test failure
*/
@Test
@Alerts({"true", "HierarchyRequestError", "1", "0"})
@Alerts({"true", "HierarchyRequestError/DOMException", "1", "0"})
public void appendChild_recursive_parent() throws Exception {
final String html = "<html><head>\n"
+ "<script>\n"
Expand Down
30 changes: 15 additions & 15 deletions src/test/java/org/htmlunit/html/HtmlFileInputTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public void getText() throws Exception {
* @throws Exception if an error occurs
*/
@Test
@Alerts({"InvalidStateError", "-Hello world-Hello world-0", "-Hello world-Hello world-0"})
@Alerts({"InvalidStateError/DOMException", "-Hello world-Hello world-0", "-Hello world-Hello world-0"})
public void setValueOnChange() throws Exception {
final String html =
"<html>\n"
Expand Down Expand Up @@ -336,7 +336,7 @@ public void defaultValuesAfterClone() throws Exception {
*/
@Test
@Alerts({"-initial-initial", "-initial-initial",
"InvalidStateError", "-initial-initial", "-initial-initial",
"InvalidStateError/DOMException", "-initial-initial", "-initial-initial",
"-newDefault-newDefault", "-newDefault-newDefault"})
public void resetByClick() throws Exception {
final String html = "<html><head>\n"
Expand Down Expand Up @@ -379,7 +379,7 @@ public void resetByClick() throws Exception {
*/
@Test
@Alerts({"-initial-initial", "-initial-initial",
"InvalidStateError", "-initial-initial", "-initial-initial",
"InvalidStateError/DOMException", "-initial-initial", "-initial-initial",
"-newDefault-newDefault", "-newDefault-newDefault"})
public void resetByJS() throws Exception {
final String html = "<html><head>\n"
Expand Down Expand Up @@ -421,8 +421,8 @@ public void resetByJS() throws Exception {
*/
@Test
@Alerts({"-initial-initial", "-default-default",
"InvalidStateError", "-default-default", "-attribValue-attribValue",
"-newDefault-newDefault"})
"InvalidStateError/DOMException", "-default-default",
"-attribValue-attribValue", "-newDefault-newDefault"})
public void value() throws Exception {
final String html = "<html><head>\n"
+ "<script>\n"
Expand Down Expand Up @@ -519,9 +519,9 @@ public void selection() throws Exception {
* @throws Exception if test fails
*/
@Test
@Alerts({"null,null", "InvalidStateError", "null,null",
"InvalidStateError", "null,null",
"InvalidStateError", "null,null"})
@Alerts({"null,null", "InvalidStateError/DOMException", "null,null",
"InvalidStateError/DOMException", "null,null",
"InvalidStateError/DOMException", "null,null"})
public void selection2_1() throws Exception {
selection2(3, 10);
}
Expand All @@ -530,9 +530,9 @@ public void selection2_1() throws Exception {
* @throws Exception if test fails
*/
@Test
@Alerts({"null,null", "InvalidStateError", "null,null",
"InvalidStateError", "null,null",
"InvalidStateError", "null,null"})
@Alerts({"null,null", "InvalidStateError/DOMException", "null,null",
"InvalidStateError/DOMException", "null,null",
"InvalidStateError/DOMException", "null,null"})
public void selection2_2() throws Exception {
selection2(-3, 15);
}
Expand All @@ -541,9 +541,9 @@ public void selection2_2() throws Exception {
* @throws Exception if test fails
*/
@Test
@Alerts({"null,null", "InvalidStateError", "null,null",
"InvalidStateError", "null,null",
"InvalidStateError", "null,null"})
@Alerts({"null,null", "InvalidStateError/DOMException", "null,null",
"InvalidStateError/DOMException", "null,null",
"InvalidStateError/DOMException", "null,null"})
public void selection2_3() throws Exception {
selection2(10, 5);
}
Expand Down Expand Up @@ -591,7 +591,7 @@ private void selection2(final int selectionStart, final int selectionEnd) throws
* @throws Exception if test fails
*/
@Test
@Alerts({"null,null", "InvalidStateError"})
@Alerts({"null,null", "InvalidStateError/DOMException"})
public void selectionOnUpdate() throws Exception {
final String html = "<html>\n"
+ "<body>\n"
Expand Down
14 changes: 7 additions & 7 deletions src/test/java/org/htmlunit/html/HtmlNumberInputTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1393,8 +1393,8 @@ public void selection() throws Exception {
* @throws Exception if test fails
*/
@Test
@Alerts({"null,null", "null,null", "InvalidStateError",
"null,null", "InvalidStateError", "null,null"})
@Alerts({"null,null", "null,null", "InvalidStateError/DOMException",
"null,null", "InvalidStateError/DOMException", "null,null"})
public void selection2_1() throws Exception {
selection2(3, 10);
}
Expand All @@ -1403,8 +1403,8 @@ public void selection2_1() throws Exception {
* @throws Exception if test fails
*/
@Test
@Alerts({"null,null", "null,null", "InvalidStateError",
"null,null", "InvalidStateError", "null,null"})
@Alerts({"null,null", "null,null", "InvalidStateError/DOMException",
"null,null", "InvalidStateError/DOMException", "null,null"})
public void selection2_2() throws Exception {
selection2(-3, 15);
}
Expand All @@ -1413,8 +1413,8 @@ public void selection2_2() throws Exception {
* @throws Exception if test fails
*/
@Test
@Alerts({"null,null", "null,null", "InvalidStateError",
"null,null", "InvalidStateError", "null,null"})
@Alerts({"null,null", "null,null", "InvalidStateError/DOMException",
"null,null", "InvalidStateError/DOMException", "null,null"})
public void selection2_3() throws Exception {
selection2(10, 5);
}
Expand Down Expand Up @@ -1460,7 +1460,7 @@ private void selection2(final int selectionStart, final int selectionEnd) throws
* @throws Exception if test fails
*/
@Test
@Alerts({"null,null", "InvalidStateError"})
@Alerts({"null,null", "InvalidStateError/DOMException"})
public void selectionOnUpdate() throws Exception {
final String html = "<html>\n"
+ "<body>\n"
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/org/htmlunit/html/xpath/HtmlUnitXPath2Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ public void attrib() throws Exception {
* @throws Exception if the test fails
*/
@Test
@Alerts("SyntaxError")
@Alerts("SyntaxError/DOMException")
public void lowerCaseNotSupported() throws Exception {
compareError("//*[lower-case(@id) = \"a\"]");
}
Expand All @@ -435,7 +435,7 @@ public void lowerCaseNotSupported() throws Exception {
* @throws Exception if the test fails
*/
@Test
@Alerts("SyntaxError")
@Alerts("SyntaxError/DOMException")
public void upperCaseNotSupported() throws Exception {
compareError("//*[upper-case(@id) = \"A\"]");
}
Expand All @@ -444,7 +444,7 @@ public void upperCaseNotSupported() throws Exception {
* @throws Exception if the test fails
*/
@Test
@Alerts("SyntaxError")
@Alerts("SyntaxError/DOMException")
public void endsWithNotSupported() throws Exception {
compareError("ends-with(\"haystack\", \"haystack\")");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public void constructor() throws Exception {
* @throws Exception if the test fails
*/
@Test
@Alerts("ReferenceError/Error")
@Alerts("ReferenceError")
public void packages() throws Exception {
object("Packages");
}
Expand All @@ -254,7 +254,7 @@ public void packages() throws Exception {
* @throws Exception if the test fails
*/
@Test
@Alerts("ReferenceError/Error")
@Alerts("ReferenceError")
public void java() throws Exception {
object("java");
}
Expand Down Expand Up @@ -1028,7 +1028,7 @@ public void falsyAndDocumentAll() throws Exception {
* @throws Exception if the test fails
*/
@Test
@Alerts("ReferenceError/Error")
@Alerts("ReferenceError")
public void javaNotAccessable() throws Exception {
final String html = "<html><head>\n"
+ "<script>\n"
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/htmlunit/javascript/NativeJSONTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class NativeJSONTest extends WebDriverTestCase {
* @throws Exception if the test fails
*/
@Test
@Alerts({"x,y", "SyntaxError/Error"})
@Alerts({"x,y", "SyntaxError"})
public void getArraySyntax() throws Exception {
final String html
= "<html>\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ public void toLocaleStringNoParam() throws Exception {
* @throws Exception if the test fails
*/
@Test
@Alerts("RangeError/Error")
@Alerts("RangeError")
public void toLocaleStringHintertupfingen() throws Exception {
final String html = "<html><head><script>\n"
+ LOG_TITLE_FUNCTION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ public void getOwnPropertySymbols() throws Exception {
* @throws Exception if the test fails
*/
@Test
@Alerts("TypeError/Error")
@Alerts("TypeError")
public void getOwnPropertySymbolsEmpty() throws Exception {
final String html = ""
+ "<html><head>\n"
Expand Down
Loading

0 comments on commit dedf6ff

Please sign in to comment.