2020import org .htmlunit .WebDriverTestCase ;
2121import org .htmlunit .junit .BrowserRunner ;
2222import org .htmlunit .junit .annotation .Alerts ;
23+ import org .htmlunit .junit .annotation .HtmlUnitNYI ;
2324import org .htmlunit .junit .annotation .NotYetImplemented ;
2425import org .htmlunit .util .MimeType ;
2526import org .junit .Test ;
@@ -1240,6 +1241,10 @@ public void async2() throws Exception {
12401241 */
12411242 @ Test
12421243 @ Alerts ("0 3 2 1" )
1244+ @ HtmlUnitNYI (CHROME = "0 3 1 2" ,
1245+ EDGE = "0 3 1 2" ,
1246+ FF = "0 3 1 2" ,
1247+ FF_ESR = "0 3 1 2" )
12431248 public void syncLoadsAsync () throws Exception {
12441249 final String html = "<html><body>\n "
12451250 + "<script>\n "
@@ -1266,6 +1271,7 @@ public void syncLoadsAsync() throws Exception {
12661271 @ Test
12671272 @ Alerts (DEFAULT = "2 0 3 1" ,
12681273 FF_ESR = "0 3 2 1" )
1274+ @ HtmlUnitNYI (FF_ESR = "2 0 3 1" )
12691275 public void asyncLoadsAsync () throws Exception {
12701276 final String html = "<html><body>\n "
12711277 + "<script src='script.js' async></script>\n "
@@ -1293,24 +1299,25 @@ public void asyncLoadsAsync() throws Exception {
12931299 * @throws Exception if the test fails
12941300 */
12951301 @ Test
1296- @ Alerts ("1 2 3" )
1302+ @ Alerts ({ "1" , "2" , "3" } )
12971303 public void asyncFromAsyncTask () throws Exception {
12981304 final String html = "<html><body><script>\n "
1305+ + LOG_TITLE_FUNCTION
12991306 + "function addAsyncScript() {\n "
13001307 + " var script = document.createElement('script');\n "
13011308 + " script.src = 'js.js';\n "
13021309 + " script.async = true;\n "
13031310 + " document.head.appendChild(script);\n "
1304- + " document.title += ' 2' ;\n "
1311+ + " log('2') ;\n "
13051312 + "}\n "
13061313 + "setTimeout(addAsyncScript, 5);\n "
1307- + "document.title += ' 1' ;\n "
1314+ + " log('1') ;\n "
13081315 + "</script></body></html>\n " ;
13091316
1310- getMockWebConnection ().setResponse (new URL (URL_FIRST , "js.js" ), "document.title += ' 3'; " );
1317+ getMockWebConnection ().setResponse (new URL (URL_FIRST , "js.js" ), "log('3') " );
13111318
13121319 final WebDriver driver = loadPage2 (html );
1313- assertTitle ( driver , getExpectedAlerts ()[ 0 ] );
1320+ verifyTitle2 ( DEFAULT_WAIT_TIME , driver , getExpectedAlerts ());
13141321 }
13151322
13161323 /**
0 commit comments