Skip to content

Commit 67ee953

Browse files
committed
more detailed tests
1 parent da9b871 commit 67ee953

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

src/test/java/org/htmlunit/javascript/JavaScriptEngine2Test.java

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,45 @@ public void ctorBooleanDocumentAll() throws Exception {
992992
loadPageVerifyTitle2(html);
993993
}
994994

995+
/**
996+
* @throws Exception if the test fails
997+
*/
998+
@Test
999+
@Alerts("false")
1000+
public void falsyDocumentAll() throws Exception {
1001+
final String html = "<html><head>\n"
1002+
+ "<script>\n"
1003+
+ LOG_TITLE_FUNCTION
1004+
+ "function test() {\n"
1005+
+ " if (document.all) log('true'); else log('false');\n"
1006+
+ "}\n"
1007+
+ "</script></head>\n"
1008+
+ "<body onload='test()'>\n"
1009+
+ "</body></html>";
1010+
1011+
loadPageVerifyTitle2(html);
1012+
}
1013+
1014+
/**
1015+
* @throws Exception if the test fails
1016+
*/
1017+
@Test
1018+
@Alerts("[object HTMLAllCollection]")
1019+
public void falsyAndDocumentAll() throws Exception {
1020+
final String html = "<html><head>\n"
1021+
+ "<script>\n"
1022+
+ LOG_TITLE_FUNCTION
1023+
+ "function test() {\n"
1024+
+ " var res = document.all && 'Html';\n"
1025+
+ " log(res);\n"
1026+
+ "}\n"
1027+
+ "</script></head>\n"
1028+
+ "<body onload='test()'>\n"
1029+
+ "</body></html>";
1030+
1031+
loadPageVerifyTitle2(html);
1032+
}
1033+
9951034
/**
9961035
* @throws Exception if the test fails
9971036
*/

0 commit comments

Comments
 (0)