2424import org .htmlunit .WebDriverTestCase ;
2525import org .htmlunit .junit .BrowserRunner ;
2626import org .htmlunit .junit .annotation .Alerts ;
27+ import org .htmlunit .junit .annotation .HtmlUnitNYI ;
2728import org .htmlunit .util .MimeType ;
2829import org .htmlunit .util .NameValuePair ;
2930import org .junit .Test ;
@@ -2056,8 +2057,14 @@ public void widthHeightPercent() throws Exception {
20562057 * @throws Exception if the test fails
20572058 */
20582059 @ Test
2059- @ Alerts ({"0 622 / 722" , "1 622 / 722" , "2 622 / 722" , "3 622 / 722" ,
2060- "4 622 / 722" , "5 622 / 722" , "6 622 / 722" })
2060+ @ Alerts (CHROME = "break at: 10 660.5833740234375 / 622" ,
2061+ EDGE = "break at: 10 660.5833740234375 / 631" ,
2062+ FF = "break at: 11 726.63330078125 / 676" ,
2063+ FF_ESR = "break at: 11 726.63330078125 / 677" )
2064+ @ HtmlUnitNYI (CHROME = "break at: 33 620 / 605" ,
2065+ EDGE = "break at: 33 620 / 605" ,
2066+ FF = "break at: 33 620 / 605" ,
2067+ FF_ESR = "break at: 33 620 / 605" )
20612068 public void endlessLoop () throws Exception {
20622069 final String html = DOCTYPE_HTML
20632070 + "<html>\n "
@@ -2069,16 +2076,21 @@ public void endlessLoop() throws Exception {
20692076 + "<script>\n "
20702077 + LOG_TITLE_FUNCTION
20712078
2079+ + " var lastBottom = 0;\n "
20722080 + " for (let i = 0; i < 70; i++) {\n "
20732081 + " let windowRelativeBottom = document.documentElement.getBoundingClientRect().bottom;\n "
2074- + " let stop = document.documentElement.clientHeight + 100 ;"
2082+ + " let stop = document.documentElement.clientHeight;"
20752083 + " if (windowRelativeBottom > stop) {\n "
20762084 + " log('break at: ' + i + ' ' + windowRelativeBottom + ' / ' + stop);\n "
20772085 + " break;\n "
20782086 + " }\n "
2079- + " log(i + ' ' + windowRelativeBottom + ' / ' + stop);\n "
2087+ + " if (lastBottom >= windowRelativeBottom) {\n "
2088+ + " log('error at: ' + i + ' ' + windowRelativeBottom + ' / ' + lastBottom);\n "
2089+ + " break;\n "
2090+ + " }\n "
2091+ + " lastBottom = windowRelativeBottom;\n "
20802092
2081- + " document.body.insertAdjacentHTML('beforeend', `<p>Date: ${new Date()}</p>` );\n "
2093+ + " document.body.insertAdjacentHTML('beforeend', '<h1>H 1</h1>' );\n "
20822094 + " }\n "
20832095 + "</script>\n "
20842096
0 commit comments