[HtmlUnit] SVN: [14456] trunk/htmlunit

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[HtmlUnit] SVN: [14456] trunk/htmlunit

rbri
Revision: 14456
          http://sourceforge.net/p/htmlunit/code/14456
Author:   rbri
Date:     2017-05-17 07:08:35 +0000 (Wed, 17 May 2017)
Log Message:
-----------
refactor charset tests into parameterized test (wip - have to add more parameters)

Modified Paths:
--------------
    trunk/htmlunit/checkstyle_suppressions.xml
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlScript2Test.java

Added Paths:
-----------
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlScript3Test.java

Modified: trunk/htmlunit/checkstyle_suppressions.xml
===================================================================
--- trunk/htmlunit/checkstyle_suppressions.xml 2017-05-15 18:41:37 UTC (rev 14455)
+++ trunk/htmlunit/checkstyle_suppressions.xml 2017-05-17 07:08:35 UTC (rev 14456)
@@ -59,6 +59,7 @@
     <suppress checks="MethodName" files="HostParentOfTTest.java"/>
     <suppress checks="MethodName" files="HostParentOfWTest.java"/>
     <suppress checks="MethodName" files="StyleAttributesIterableTest.java"/>
+    <suppress checks="MethodName" files="HtmlScript3Test.java"/>
 
     <suppress checks="TypeName" files="webkit.*\.java$|moz.*\.java$"/>
     <suppress checks="TypeName" files="EXT_.*\.java$|OES_.*\.java$|WEBGL_.*\.java$|ANGLE_.*\.java$"/>

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlScript2Test.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlScript2Test.java 2017-05-15 18:41:37 UTC (rev 14455)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlScript2Test.java 2017-05-17 07:08:35 UTC (rev 14456)
@@ -18,15 +18,12 @@
 import static java.nio.charset.StandardCharsets.UTF_8;
 
 import java.net.URL;
-import java.nio.charset.Charset;
 
 import org.apache.commons.io.ByteOrderMark;
-import org.apache.commons.lang3.ArrayUtils;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.openqa.selenium.By;
 import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebDriverException;
 
 import com.gargoylesoftware.htmlunit.BrowserRunner;
 import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts;
@@ -413,782 +410,4 @@
         getMockWebConnection().setResponse(URL_SECOND, script, "application/javascript", UTF_8);
         loadPageWithAlerts2(html);
     }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void null_null_null_null() throws Exception {
-        charset(null, "", null, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void null_null_null_UTF_8() throws Exception {
-        charset(null, "", null, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    public void null_null_null_UTF_16BE() throws Exception {
-        charset(null, "", null, ByteOrderMark.UTF_16BE);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void null_null_UTF_8_null() throws Exception {
-        charset(null, "", UTF_8, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void null_null_UTF_8_UTF_8() throws Exception {
-        charset(null, "", UTF_8, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    public void null_null_UTF_8_UTF_16BE() throws Exception {
-        charset(null, "", UTF_8, ByteOrderMark.UTF_16BE);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("?????")
-    public void null_null_ISO_8859_1_null() throws Exception {
-        charset(null, "", ISO_8859_1, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("?????")
-    public void null_null_ISO_8859_1_UTF_8() throws Exception {
-        charset(null, "", ISO_8859_1, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    public void null_null_ISO_8859_1_UTF_16BE() throws Exception {
-        charset(null, "", ISO_8859_1, ByteOrderMark.UTF_16BE);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void null_UTF_8_null_null() throws Exception {
-        charset(null, "; charset=utf-8", null, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void null_UTF_8_null_UTF_8() throws Exception {
-        charset(null, "; charset=utf-8", null, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    public void null_UTF_8_null_UTF_16BE() throws Exception {
-        charset(null, "; charset=utf-8", null, ByteOrderMark.UTF_16BE);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void null_UTF_8_UTF_8_null() throws Exception {
-        charset(null, "; charset=utf-8", UTF_8, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void null_UTF_8_UTF_8_UTF_8() throws Exception {
-        charset(null, "; charset=utf-8", UTF_8, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    public void null_UTF_8_UTF_8_UTF_16BE() throws Exception {
-        charset(null, "; charset=utf-8", UTF_8, ByteOrderMark.UTF_16BE);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("?????")
-    public void null_UTF_8_ISO_8859_1_null() throws Exception {
-        charset(null, "; charset=utf-8", ISO_8859_1, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("?????")
-    public void null_UTF_8_ISO_8859_1_UTF_8() throws Exception {
-        charset(null, "; charset=utf-8", ISO_8859_1, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    public void null_UTF_8_ISO_8859_1_UTF_16BE() throws Exception {
-        charset(null, "; charset=utf-8", ISO_8859_1, ByteOrderMark.UTF_16BE);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void null_ISO_8859_1_null_null() throws Exception {
-        charset(null, "; charset=iso-8859-1", null, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts(DEFAULT = "أهلاً",
-            IE = "أهلاً")
-    public void null_ISO_8859_1_null_UTF_8() throws Exception {
-        charset(null, "; charset=iso-8859-1", null, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    public void null_ISO_8859_1_null_UTF_16BE() throws Exception {
-        charset(null, "", null, ByteOrderMark.UTF_16BE);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void null_ISO_8859_1_UTF_8_null() throws Exception {
-        charset(null, "; charset=iso-8859-1", UTF_8, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts(DEFAULT = "أهلاً",
-            IE = "أهلاً")
-    public void null_ISO_8859_1_UTF_8_UTF_8() throws Exception {
-        charset(null, "; charset=iso-8859-1", UTF_8, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    public void null_ISO_8859_1_UTF_8_UTF_16BE() throws Exception {
-        charset(null, "; charset=iso-8859-1", UTF_8, ByteOrderMark.UTF_16BE);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("?????")
-    public void null_ISO_8859_1_ISO_8859_1_null() throws Exception {
-        charset(null, "; charset=iso-8859-1", ISO_8859_1, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("?????")
-    public void null_ISO_8859_1_ISO_8859_1_UTF_8() throws Exception {
-        charset(null, "; charset=iso-8859-1", ISO_8859_1, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts(DEFAULT = {},
-            IE = "?????")
-    public void null_ISO_8859_1_ISO_8859_1_UTF_16BE() throws Exception {
-        charset(null, "; charset=iso-8859-1", ISO_8859_1, ByteOrderMark.UTF_16BE);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void UTF_8_null_null_null() throws Exception {
-        charset(UTF_8, "", null, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void UTF_8_null_null_UTF_8() throws Exception {
-        charset(UTF_8, "", null, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    public void UTF_8_null_null_UTF_16BE() throws Exception {
-        charset(UTF_8, "", null, ByteOrderMark.UTF_16BE);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void UTF_8_null_UTF_8_null() throws Exception {
-        charset(UTF_8, "", UTF_8, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void UTF_8_null_UTF_8_UTF_8() throws Exception {
-        charset(UTF_8, "", UTF_8, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    public void UTF_8_null_UTF_8_UTF_16BE() throws Exception {
-        charset(UTF_8, "", UTF_8, ByteOrderMark.UTF_16BE);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("?????")
-    public void UTF_8_null_ISO_8859_1_null() throws Exception {
-        charset(UTF_8, "", ISO_8859_1, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("?????")
-    public void UTF_8_null_ISO_8859_1_UTF_8() throws Exception {
-        charset(UTF_8, "", ISO_8859_1, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    public void UTF_8_null_ISO_8859_1_UTF_16BE() throws Exception {
-        charset(UTF_8, "", ISO_8859_1, ByteOrderMark.UTF_16BE);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void UTF_8_UTF_8_null_null() throws Exception {
-        charset(UTF_8, "; charset=utf-8", null, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void UTF_8_UTF_8_null_UTF_8() throws Exception {
-        charset(UTF_8, "; charset=utf-8", null, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts(DEFAULT = {},
-            IE = "أهلاً")
-    public void UTF_8_UTF_8_null_UTF_16BE() throws Exception {
-        charset(UTF_8, "; charset=utf-8", null, ByteOrderMark.UTF_16BE);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void UTF_8_UTF_8_UTF_8_null() throws Exception {
-        charset(UTF_8, "; charset=utf-8", UTF_8, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void UTF_8_UTF_8_UTF_8_UTF_8() throws Exception {
-        charset(UTF_8, "; charset=utf-8", UTF_8, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts(DEFAULT = {},
-            IE = "أهلاً")
-    public void UTF_8_UTF_8_UTF_8_UTF_16BE() throws Exception {
-        charset(UTF_8, "; charset=utf-8", UTF_8, ByteOrderMark.UTF_16BE);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("?????")
-    public void UTF_8_UTF_8_ISO_8859_1_null() throws Exception {
-        charset(UTF_8, "; charset=utf-8", ISO_8859_1, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("?????")
-    public void UTF_8_UTF_8_ISO_8859_1_UTF_8() throws Exception {
-        charset(UTF_8, "; charset=utf-8", ISO_8859_1, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts(DEFAULT = {},
-            IE = "?????")
-    public void UTF_8_UTF_8_ISO_8859_1_UTF_16BE() throws Exception {
-        charset(UTF_8, "; charset=utf-8", ISO_8859_1, ByteOrderMark.UTF_16BE);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void UTF_8_ISO_8859_1_null_null() throws Exception {
-        charset(UTF_8, "; charset=iso-8859-1", null, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts(DEFAULT = "أهلاً",
-            IE = "أهلاً")
-    public void UTF_8_ISO_8859_1_null_UTF_8() throws Exception {
-        charset(UTF_8, "; charset=iso-8859-1", null, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    public void UTF_8_ISO_8859_1_null_UTF_16BE() throws Exception {
-        charset(UTF_8, "", null, ByteOrderMark.UTF_16BE);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void UTF_8_ISO_8859_1_UTF_8_null() throws Exception {
-        charset(UTF_8, "; charset=iso-8859-1", UTF_8, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts(DEFAULT = "أهلاً",
-            IE = "أهلاً")
-    public void UTF_8_ISO_8859_1_UTF_8_UTF_8() throws Exception {
-        charset(UTF_8, "; charset=iso-8859-1", UTF_8, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts(DEFAULT = {},
-            IE = "أهلاً")
-    public void UTF_8_ISO_8859_1_UTF_8_UTF_16BE() throws Exception {
-        charset(UTF_8, "; charset=iso-8859-1", UTF_8, ByteOrderMark.UTF_16BE);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("?????")
-    public void UTF_8_ISO_8859_1_ISO_8859_1_null() throws Exception {
-        charset(UTF_8, "; charset=iso-8859-1", ISO_8859_1, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("?????")
-    public void UTF_8_ISO_8859_1_ISO_8859_1_UTF_8() throws Exception {
-        charset(UTF_8, "; charset=iso-8859-1", ISO_8859_1, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts(DEFAULT = {},
-            IE = "?????")
-    public void UTF_8_ISO_8859_1_ISO_8859_1_UTF_16BE() throws Exception {
-        charset(UTF_8, "; charset=iso-8859-1", ISO_8859_1, ByteOrderMark.UTF_16BE);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void ISO_8859_1_null_null_null() throws Exception {
-        charset(ISO_8859_1, "", null, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void ISO_8859_1_null_null_UTF_8() throws Exception {
-        charset(ISO_8859_1, "", null, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    public void ISO_8859_1_null_null_UTF_16BE() throws Exception {
-        charset(ISO_8859_1, "", null, ByteOrderMark.UTF_16BE);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void ISO_8859_1_null_UTF_8_null() throws Exception {
-        charset(ISO_8859_1, "", UTF_8, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void ISO_8859_1_null_UTF_8_UTF_8() throws Exception {
-        charset(ISO_8859_1, "", UTF_8, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    public void ISO_8859_1_null_UTF_8_UTF_16BE() throws Exception {
-        charset(ISO_8859_1, "", UTF_8, ByteOrderMark.UTF_16BE);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("?????")
-    public void ISO_8859_1_null_ISO_8859_1_null() throws Exception {
-        charset(ISO_8859_1, "", ISO_8859_1, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("?????")
-    public void ISO_8859_1_null_ISO_8859_1_UTF_8() throws Exception {
-        charset(ISO_8859_1, "", ISO_8859_1, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    public void ISO_8859_1_null_ISO_8859_1_UTF_16BE() throws Exception {
-        charset(ISO_8859_1, "", ISO_8859_1, ByteOrderMark.UTF_16BE);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void ISO_8859_1_UTF_8_null_null() throws Exception {
-        charset(ISO_8859_1, "; charset=utf-8", null, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void ISO_8859_1_UTF_8_null_UTF_8() throws Exception {
-        charset(ISO_8859_1, "; charset=utf-8", null, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts(DEFAULT = {},
-            IE = "أهلاً")
-    public void ISO_8859_1_UTF_8_null_UTF_16BE() throws Exception {
-        charset(ISO_8859_1, "; charset=utf-8", null, ByteOrderMark.UTF_16BE);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void ISO_8859_1_UTF_8_UTF_8_null() throws Exception {
-        charset(ISO_8859_1, "; charset=utf-8", UTF_8, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void ISO_8859_1_UTF_8_UTF_8_UTF_8() throws Exception {
-        charset(ISO_8859_1, "; charset=utf-8", UTF_8, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts(DEFAULT = {},
-            IE = "أهلاً")
-    public void ISO_8859_1_UTF_8_UTF_8_UTF_16BE() throws Exception {
-        charset(ISO_8859_1, "; charset=utf-8", UTF_8, ByteOrderMark.UTF_16BE);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("?????")
-    public void ISO_8859_1_UTF_8_ISO_8859_1_null() throws Exception {
-        charset(ISO_8859_1, "; charset=utf-8", ISO_8859_1, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("?????")
-    public void ISO_8859_1_UTF_8_ISO_8859_1_UTF_8() throws Exception {
-        charset(ISO_8859_1, "; charset=utf-8", ISO_8859_1, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts(DEFAULT = {},
-            IE = "?????")
-    public void ISO_8859_1_UTF_8_ISO_8859_1_UTF_16BE() throws Exception {
-        charset(ISO_8859_1, "; charset=utf-8", ISO_8859_1, ByteOrderMark.UTF_16BE);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void ISO_8859_1_ISO_8859_1_null_null() throws Exception {
-        charset(ISO_8859_1, "; charset=iso-8859-1", null, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts(DEFAULT = "أهلاً",
-            IE = "أهلاً")
-    public void ISO_8859_1_ISO_8859_1_null_UTF_8() throws Exception {
-        charset(ISO_8859_1, "; charset=iso-8859-1", null, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    public void ISO_8859_1_ISO_8859_1_null_UTF_16BE() throws Exception {
-        charset(ISO_8859_1, "", null, ByteOrderMark.UTF_16BE);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("أهلاً")
-    public void ISO_8859_1_ISO_8859_1_UTF_8_null() throws Exception {
-        charset(ISO_8859_1, "; charset=iso-8859-1", UTF_8, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts(DEFAULT = "أهلاً",
-            IE = "أهلاً")
-    public void ISO_8859_1_ISO_8859_1_UTF_8_UTF_8() throws Exception {
-        charset(ISO_8859_1, "; charset=iso-8859-1", UTF_8, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts(DEFAULT = {},
-            IE = "أهلاً")
-    public void ISO_8859_1_ISO_8859_1_UTF_8_UTF_16BE() throws Exception {
-        charset(ISO_8859_1, "; charset=iso-8859-1", UTF_8, ByteOrderMark.UTF_16BE);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("?????")
-    public void ISO_8859_1_ISO_8859_1_ISO_8859_1_null() throws Exception {
-        charset(ISO_8859_1, "; charset=iso-8859-1", ISO_8859_1, null);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts("?????")
-    public void ISO_8859_1_ISO_8859_1_ISO_8859_1_UTF_8() throws Exception {
-        charset(ISO_8859_1, "; charset=iso-8859-1", ISO_8859_1, ByteOrderMark.UTF_8);
-    }
-
-    /**
-     * @throws Exception if the test fails
-     */
-    @Test
-    @Alerts(DEFAULT = {},
-            IE = "?????")
-    public void ISO_8859_1_ISO_8859_1_ISO_8859_1_UTF_16BE() throws Exception {
-        charset(ISO_8859_1, "; charset=iso-8859-1", ISO_8859_1, ByteOrderMark.UTF_16BE);
-    }
-
-    private void charset(final Charset charsetAttribute,
-            final String charsetResponseHeader,
-            final Charset charsetResponseEncoding,
-            final ByteOrderMark bom) throws Exception {
-
-        // use always a different url to avoid caching effects
-        final URL cssUrl = new URL(URL_SECOND, "" + System.currentTimeMillis() + ".js");
-
-        String html
-            = "<html><head>\n"
-            + "  <script src='" + cssUrl + "'";
-        if (charsetAttribute != null) {
-            html = html + " charset='" + charsetAttribute + "'";
-        }
-        html = html + "></script>\n"
-            + "</head>\n"
-            + "<body></body>\n"
-            + "</html>";
-
-        final String js = "alert('أهلاً');";
-        byte[] script = null;
-        if (charsetResponseEncoding == null) {
-            script = js.getBytes(UTF_8);
-        }
-        else {
-            script = js.getBytes(charsetResponseEncoding);
-        }
-        if (bom == null) {
-            getMockWebConnection().setResponse(cssUrl, script, 200, "OK",
-                    "application/javascript" + charsetResponseHeader, null);
-        }
-        else {
-            script = ArrayUtils.addAll(bom.getBytes(), script);
-            getMockWebConnection().setResponse(cssUrl, script, 200, "OK",
-                    "application/javascript" + charsetResponseHeader, null);
-        }
-
-        try {
-            loadPageWithAlerts2(html);
-        }
-        catch (final WebDriverException e) {
-            if (!e.getCause().getMessage().contains("illegal character")
-                && !e.getCause().getMessage().contains("is not defined.")) {
-                throw e;
-            }
-        }
-    }
 }

Added: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlScript3Test.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlScript3Test.java                        (rev 0)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlScript3Test.java 2017-05-17 07:08:35 UTC (rev 14456)
@@ -0,0 +1,734 @@
+/*
+ * Copyright (c) 2002-2017 Gargoyle Software Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.gargoylesoftware.htmlunit.html;
+
+import static java.nio.charset.StandardCharsets.ISO_8859_1;
+import static java.nio.charset.StandardCharsets.UTF_8;
+
+import java.net.URL;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.commons.io.ByteOrderMark;
+import org.apache.commons.lang3.ArrayUtils;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized.Parameter;
+import org.junit.runners.Parameterized.Parameters;
+import org.openqa.selenium.WebDriverException;
+
+import com.gargoylesoftware.htmlunit.BrowserParameterizedRunner;
+import com.gargoylesoftware.htmlunit.BrowserParameterizedRunner.Default;
+import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts;
+import com.gargoylesoftware.htmlunit.WebDriverTestCase;
+
+/**
+ * Tests encoding handling for {@link HtmlScript}.
+ *
+ * @author Ronald Brill
+ */
+@RunWith(BrowserParameterizedRunner.class)
+public class HtmlScript3Test extends WebDriverTestCase {
+
+    private static final String BOM_UTF_16BE = "BOMUTF16BE";
+    private static final String BOM_UTF_8 = "BOMUTF8";
+
+    private enum TestCharset {
+        UTF8("UTF8", UTF_8),
+        ISO88591("ISO88591", ISO_8859_1);
+
+        private final String label_;
+        private final Charset charset_;
+
+        TestCharset(final String label, final Charset charset) {
+            label_ = label;
+            charset_ = charset;
+        }
+
+        @Override
+        public String toString() {
+            return label_;
+        }
+
+        public Charset getCharset() {
+            return charset_;
+        }
+    }
+
+    /**
+     * Returns the parameterized data.
+     * @return the parameterized data
+     * @throws Exception if an error occurs
+     */
+    @Parameters
+    public static Collection<Object[]> data() throws Exception {
+        final List<Object[]> list = new ArrayList<>();
+
+        final TestCharset[] charsetAttribute = new TestCharset[] {null, TestCharset.UTF8, TestCharset.ISO88591};
+        final TestCharset[] charsetResponseHeader = new TestCharset[] {null, TestCharset.UTF8, TestCharset.ISO88591};
+        final TestCharset[] charsetResponseEncoding = new TestCharset[] {null, TestCharset.UTF8, TestCharset.ISO88591};
+        final String[] bom = new String[] {null, BOM_UTF_8, BOM_UTF_16BE};
+
+        for (final Object attribute : charsetAttribute) {
+            for (final Object responseHeader : charsetResponseHeader) {
+                for (final Object responseEncoding : charsetResponseEncoding) {
+                    for (final Object b : bom) {
+                        list.add(new Object[] {attribute, responseHeader, responseEncoding, b});
+                    }
+                }
+            }
+        }
+        return list;
+    }
+
+    /**
+     * The charsetAttribute.
+     */
+    @Parameter
+    public TestCharset charsetAttribute_;
+
+    /**
+     * The charsetResponseHeader.
+     */
+    @Parameter(1)
+    public TestCharset charsetResponseHeader_;
+
+    /**
+     * The charsetResponseEncoding.
+     */
+    @Parameter(2)
+    public TestCharset charsetResponseEncoding_;
+
+    /**
+     * The bom.
+     */
+    @Parameter(3)
+    public String bom_;
+
+    /**
+     * The default test.
+     * @throws Exception if an error occurs
+     */
+    @Test
+    @Alerts("أهلاً")
+    @Default
+    public void charset() throws Exception {
+        charset(charsetAttribute_, charsetResponseHeader_, charsetResponseEncoding_, bom_);
+    }
+
+    private void charset(final TestCharset charsetAttribute,
+            final TestCharset charsetResponseHeader,
+            final TestCharset charsetResponseEncoding,
+            final String bom) throws Exception {
+
+        // use always a different url to avoid caching effects
+        final URL cssUrl = new URL(URL_SECOND, "" + System.currentTimeMillis() + ".js");
+
+        String html
+            = "<html><head>\n"
+            + "  <script src='" + cssUrl + "'";
+        if (charsetAttribute != null) {
+            html = html + " charset='" + charsetAttribute.getCharset().name().toLowerCase() + "'";
+        }
+        html = html + "></script>\n"
+            + "</head>\n"
+            + "<body></body>\n"
+            + "</html>";
+
+        String contentType = "application/javascript";
+        if (charsetResponseHeader != null) {
+            contentType = contentType + "; charset=" + charsetResponseHeader.getCharset().name().toLowerCase();
+        }
+        final String js = "alert('أهلاً');";
+
+        byte[] script = null;
+        if (charsetResponseEncoding == null) {
+            script = js.getBytes(UTF_8);
+        }
+        else {
+            script = js.getBytes(charsetResponseEncoding.getCharset());
+        }
+
+        if (BOM_UTF_8.equals(bom)) {
+            script = ArrayUtils.addAll(ByteOrderMark.UTF_8.getBytes(), script);
+        }
+        else if (BOM_UTF_16BE.equals(bom)) {
+            script = ArrayUtils.addAll(ByteOrderMark.UTF_16BE.getBytes(), script);
+        }
+        getMockWebConnection().setResponse(cssUrl, script, 200, "OK", contentType, null);
+
+        try {
+            loadPageWithAlerts2(html);
+        }
+        catch (final WebDriverException e) {
+            if (!e.getCause().getMessage().contains("illegal character")
+                && !e.getCause().getMessage().contains("is not defined.")) {
+                throw e;
+            }
+        }
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("أهلاً")
+    public void ____() throws Exception {
+        charset(null, null, null, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void ____BOMUTF16BE() throws Exception {
+        charset(null, null, null, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("أهلاً")
+    public void ___UTF8_() throws Exception {
+        charset(null, null, TestCharset.UTF8, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void ___UTF8_BOMUTF16BE() throws Exception {
+        charset(null, null, TestCharset.UTF8, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void ___ISO88591_() throws Exception {
+        charset(null, null, TestCharset.ISO88591, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void ___ISO88591_BOMUTF8() throws Exception {
+        charset(null, null, TestCharset.ISO88591, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void ___ISO88591_BOMUTF16BE() throws Exception {
+        charset(null, null, TestCharset.ISO88591, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void __UTF8__BOMUTF16BE() throws Exception {
+        charset(null, TestCharset.UTF8, null, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void __UTF8_UTF8_BOMUTF16BE() throws Exception {
+        charset(null, TestCharset.UTF8, TestCharset.UTF8, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void __UTF8_ISO88591_() throws Exception {
+        charset(null, TestCharset.UTF8, TestCharset.ISO88591, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void __UTF8_ISO88591_BOMUTF8() throws Exception {
+        charset(null, TestCharset.UTF8, TestCharset.ISO88591, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void __UTF8_ISO88591_BOMUTF16BE() throws Exception {
+        charset(null, TestCharset.UTF8, TestCharset.ISO88591, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("أهلاً")
+    public void __ISO88591__() throws Exception {
+        charset(null, TestCharset.ISO88591, null, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts(DEFAULT = "أهلاً",
+            IE = "أهلاً")
+    public void __ISO88591__BOMUTF8() throws Exception {
+        charset(null, TestCharset.ISO88591, null, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void __ISO88591__BOMUTF16BE() throws Exception {
+        charset(null, null, null, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("أهلاً")
+    public void __ISO88591_UTF8_() throws Exception {
+        charset(null, TestCharset.ISO88591, TestCharset.UTF8, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts(DEFAULT = "أهلاً",
+            IE = "أهلاً")
+    public void __ISO88591_UTF8_BOMUTF8() throws Exception {
+        charset(null, TestCharset.ISO88591, TestCharset.UTF8, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void __ISO88591_UTF8_BOMUTF16BE() throws Exception {
+        charset(null, TestCharset.ISO88591, TestCharset.UTF8, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void __ISO88591_ISO88591_() throws Exception {
+        charset(null, TestCharset.ISO88591, TestCharset.ISO88591, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void __ISO88591_ISO88591_BOMUTF8() throws Exception {
+        charset(null, TestCharset.ISO88591, TestCharset.ISO88591, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts(DEFAULT = {},
+            IE = "?????")
+    public void __ISO88591_ISO88591_BOMUTF16BE() throws Exception {
+        charset(null, TestCharset.ISO88591, TestCharset.ISO88591, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8___BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, null, null, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8__UTF8_BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, null, TestCharset.UTF8, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _UTF8__ISO88591_() throws Exception {
+        charset(TestCharset.UTF8, null, TestCharset.ISO88591, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _UTF8__ISO88591_BOMUTF8() throws Exception {
+        charset(TestCharset.UTF8, null, TestCharset.ISO88591, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8__ISO88591_BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, null, TestCharset.ISO88591, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts(DEFAULT = {},
+            IE = "أهلاً")
+    public void _UTF8_UTF8__BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.UTF8, null, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts(DEFAULT = {},
+            IE = "أهلاً")
+    public void _UTF8_UTF8_UTF8_BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.UTF8, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _UTF8_UTF8_ISO88591_() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _UTF8_UTF8_ISO88591_BOMUTF8() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts(DEFAULT = {},
+            IE = "?????")
+    public void _UTF8_UTF8_ISO88591_BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.UTF8, TestCharset.ISO88591, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("أهلاً")
+    public void _UTF8_ISO88591__() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, null, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts(DEFAULT = "أهلاً",
+            IE = "أهلاً")
+    public void _UTF8_ISO88591__BOMUTF8() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, null, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _UTF8_ISO88591__BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, null, null, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("أهلاً")
+    public void _UTF8_ISO88591_UTF8_() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts(DEFAULT = "أهلاً",
+            IE = "أهلاً")
+    public void _UTF8_ISO88591_UTF8_BOMUTF8() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts(DEFAULT = {},
+            IE = "أهلاً")
+    public void _UTF8_ISO88591_UTF8_BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.UTF8, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _UTF8_ISO88591_ISO88591_() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _UTF8_ISO88591_ISO88591_BOMUTF8() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts(DEFAULT = {},
+            IE = "?????")
+    public void _UTF8_ISO88591_ISO88591_BOMUTF16BE() throws Exception {
+        charset(TestCharset.UTF8, TestCharset.ISO88591, TestCharset.ISO88591, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("أهلاً")
+    public void _ISO88591___() throws Exception {
+        charset(TestCharset.ISO88591, null, null, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _ISO88591___BOMUTF16BE() throws Exception {
+        charset(TestCharset.ISO88591, null, null, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("أهلاً")
+    public void _ISO88591__UTF8_() throws Exception {
+        charset(TestCharset.ISO88591, null, TestCharset.UTF8, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _ISO88591__UTF8_BOMUTF16BE() throws Exception {
+        charset(TestCharset.ISO88591, null, TestCharset.UTF8, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _ISO88591__ISO88591_() throws Exception {
+        charset(TestCharset.ISO88591, null, TestCharset.ISO88591, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _ISO88591__ISO88591_BOMUTF8() throws Exception {
+        charset(TestCharset.ISO88591, null, TestCharset.ISO88591, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _ISO88591__ISO88591_BOMUTF16BE() throws Exception {
+        charset(TestCharset.ISO88591, null, TestCharset.ISO88591, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts(DEFAULT = {},
+            IE = "أهلاً")
+    public void _ISO88591_UTF8__BOMUTF16BE() throws Exception {
+        charset(TestCharset.ISO88591, TestCharset.UTF8, null, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts(DEFAULT = {},
+            IE = "أهلاً")
+    public void _ISO88591_UTF8_UTF8_BOMUTF16BE() throws Exception {
+        charset(TestCharset.ISO88591, TestCharset.UTF8, TestCharset.UTF8, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _ISO88591_UTF8_ISO88591_() throws Exception {
+        charset(TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _ISO88591_UTF8_ISO88591_BOMUTF8() throws Exception {
+        charset(TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts(DEFAULT = {},
+            IE = "?????")
+    public void _ISO88591_UTF8_ISO88591_BOMUTF16BE() throws Exception {
+        charset(TestCharset.ISO88591, TestCharset.UTF8, TestCharset.ISO88591, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("أهلاً")
+    public void _ISO88591_ISO88591__() throws Exception {
+        charset(TestCharset.ISO88591, TestCharset.ISO88591, null, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts(DEFAULT = "أهلاً",
+            IE = "أهلاً")
+    public void _ISO88591_ISO88591__BOMUTF8() throws Exception {
+        charset(TestCharset.ISO88591, TestCharset.ISO88591, null, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    public void _ISO88591_ISO88591__BOMUTF16BE() throws Exception {
+        charset(TestCharset.ISO88591, TestCharset.ISO88591, null, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("أهلاً")
+    public void _ISO88591_ISO88591_UTF8_() throws Exception {
+        charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.UTF8, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts(DEFAULT = "أهلاً",
+            IE = "أهلاً")
+    public void _ISO88591_ISO88591_UTF8_BOMUTF8() throws Exception {
+        charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.UTF8, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts(DEFAULT = {},
+            IE = "أهلاً")
+    public void _ISO88591_ISO88591_UTF8_BOMUTF16BE() throws Exception {
+        charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.UTF8, BOM_UTF_16BE);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _ISO88591_ISO88591_ISO88591_() throws Exception {
+        charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, null);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts("?????")
+    public void _ISO88591_ISO88591_ISO88591_BOMUTF8() throws Exception {
+        charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, BOM_UTF_8);
+    }
+
+    /**
+     * @throws Exception if the test fails
+     */
+    @Test
+    @Alerts(DEFAULT = {},
+            IE = "?????")
+    public void _ISO88591_ISO88591_ISO88591_BOMUTF16BE() throws Exception {
+        charset(TestCharset.ISO88591, TestCharset.ISO88591, TestCharset.ISO88591, BOM_UTF_16BE);
+    }
+}


Property changes on: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlScript3Test.java
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
Loading...