File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
src/test/java/org/htmlunit/javascript Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff 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 */
You can’t perform that action at this time.
0 commit comments