@@ -303,8 +303,9 @@ public void fetchGetJson() throws Exception {
303303 "[object\\ sBlob]" , "4" , "text/plain;charset=iso-8859-1" },
304304 FF_ESR = {"200" , "OK" , "true" , "text/plain;charset=iso-8859-1" ,
305305 "[object\\ sBlob]" , "4" , "text/plain;charset=iso-8859-1" })
306- @ HtmlUnitNYI (FF = {"200" , "OK" , "true" , "text/plain;charset=iso-8859-1" ,
307- "[object\\ sBlob]" , "4" , "text/plain" },
306+ @ HtmlUnitNYI (
307+ FF = {"200" , "OK" , "true" , "text/plain;charset=iso-8859-1" ,
308+ "[object\\ sBlob]" , "4" , "text/plain" },
308309 FF_ESR = {"200" , "OK" , "true" , "text/plain;charset=iso-8859-1" ,
309310 "[object\\ sBlob]" , "4" , "text/plain" })
310311 public void fetchGetBlob () throws Exception {
@@ -514,7 +515,7 @@ public void fetchPostFormData() throws Exception {
514515 * @throws Exception if the test fails
515516 */
516517 @ Test
517- @ Alerts ({"200" , "OK" , "true" })
518+ @ Alerts ({"200" , "OK" , "true" , "[object \\ sPromise]§Hello1 \\ nHello1" , "Hello2 \\ nHello2" })
518519 public void fetchMultipartFormData () throws Exception {
519520 final String html = DOCTYPE_HTML
520521 + "<html>\n "
@@ -526,23 +527,37 @@ public void fetchMultipartFormData() throws Exception {
526527 + " log(response.status);\n "
527528 + " log(response.statusText);\n "
528529 + " log(response.ok);\n "
529- + " })\n "
530- + " .then(response => {\n "
531- + " return response.formData();\n "
530+
531+ + " let fd = response.formData();"
532+ + " log(fd);\n "
533+ + " return fd;\n "
532534 + " })\n "
533535 + " .then(formData => {\n "
534536 + " log(formData.get('test0'));\n "
535537 + " log(formData.get('test1'));\n "
536538 + " })\n "
537- + " .catch(e => logEx(e ));\n "
539+ + " .catch(e => log(e.message ));\n "
538540 + " </script>\n "
539541 + " </body>\n "
540542 + "</html>" ;
541543
542- final String content = "--0123456789\r \n Content-Disposition: form-data;name=test0\r \n Content-Type: text/plain\r \n Hello1\n Hello1\r \n --0123456789\r \n Content-Disposition: form-data;name=test1\r \n Content-Type: text/plain\r \n Hello2\n Hello2\r \n --0123456789--" ;
543- getMockWebConnection ().setResponse (URL_SECOND , content , "multipart/form-data; boundary=0123456789" );
544+ final String boundary = "0123456789" ;
545+ final String content = "--" + boundary + "\r \n "
546+ + "Content-Disposition: form-data; name=\" test0\" \r \n "
547+ + "Content-Type: text/plain\r \n "
548+ + "\r \n "
549+ + "Hello1\n Hello1\r \n "
550+ + "--" + boundary + "\r \n "
551+ + "Content-Disposition: form-data; name=\" test1\" \r \n "
552+ + "Content-Type: text/plain\r \n "
553+ + "\r \n "
554+ + "Hello2\n Hello2\r \n "
555+ + "--" + boundary + "--" ;
556+
557+ getMockWebConnection ().setResponse (URL_SECOND , content , "multipart/form-data; boundary=" + boundary );
544558
545- final WebDriver driver = loadPage2 (html );
559+ final WebDriver driver = enableFetchPolyfill ();
560+ loadPage2 (html );
546561 verifyTitle2 (DEFAULT_WAIT_TIME , driver , getExpectedAlerts ());
547562
548563 assertEquals (URL_SECOND , getMockWebConnection ().getLastWebRequest ().getUrl ());
@@ -552,7 +567,6 @@ public void fetchMultipartFormData() throws Exception {
552567 * @throws Exception if the test fails
553568 */
554569 @ Test
555- @ Disabled
556570 @ Alerts ({"200" , "OK" , "true" })
557571 public void fetchPostURLSearchParams () throws Exception {
558572 final String html = DOCTYPE_HTML
0 commit comments