[HtmlUnit] SVN: [15324] trunk/htmlunit/src
rbri--- via HtmlUnit-develop <[email protected]>
| Newsgroups | gmane.comp.java.htmlunit.devel |
|---|---|
| Message-ID | <[email protected]> |
Revision: 15324
http://sourceforge.net/p/htmlunit/code/15324
Author: rbri
Date: 2018-06-16 12:34:48 +0000 (Sat, 16 Jun 2018)
Log Message:
-----------
ff60 support (wip)
Modified Paths:
--------------
trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/SupportedBrowser.java
trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/DateTimeFormat.java
trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/intl/DateTimeFormatTest.java
Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/SupportedBrowser.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/SupportedBrowser.java 2018-06-16 06:29:17 UTC (rev 15323)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/SupportedBrowser.java 2018-06-16 12:34:48 UTC (rev 15324)
@@ -33,7 +33,7 @@
/** All versions of Firefox. */
FF,
- /** Firefox 45. */
+ /** Firefox 60. */
FF60,
/** Firefox 52. */
Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/DateTimeFormat.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/DateTimeFormat.java 2018-06-16 06:29:17 UTC (rev 15323)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/intl/DateTimeFormat.java 2018-06-16 12:34:48 UTC (rev 15324)
@@ -115,7 +115,7 @@
commonFormats.put("ja", yyyySlash);
commonFormats.put("ko", yyyyDotBlankDot);
commonFormats.put("lt", yyyyDash);
- commonFormats.put("lv", ddDotDot);
+ commonFormats.put("lv", yyyyDotDot);
commonFormats.put("mk", ddDot);
commonFormats.put("ms", ddSlash);
commonFormats.put("mt", yyyyDash);
@@ -144,21 +144,18 @@
commonFormats.put("en-PH", ddSlash);
commonFormats.put("es-US", ddSlash);
commonFormats.put("ga", ddSlash);
- commonFormats.put("hr", ddDotDot);
+ commonFormats.put("fr-CH", ddDot);
commonFormats.put("ja-JP-u-ca-japanese", "yy/MM/dd");
+ commonFormats.put("mt", ddSlash);
+ commonFormats.put("nl-BE", ddSlash);
commonFormats.put("sk", ddDotBlank);
commonFormats.put("sr", ddDotDot);
commonFormats.put("sq", ddDot);
FF_52_FORMATS_.putAll(commonFormats);
- FF_52_FORMATS_.put("fr", ddSlash);
- FF_52_FORMATS_.put("hr", ddDotBlankDot);
- FF_52_FORMATS_.put("fr-CH", ddDot);
- FF_52_FORMATS_.put("lv", yyyyDotDot);
- FF_52_FORMATS_.put("mt", ddSlash);
- FF_52_FORMATS_.put("nl-BE", ddSlash);
FF_60_FORMATS_.putAll(commonFormats);
+ FF_60_FORMATS_.put("ban", mmSlash);
CHROME_FORMATS_.put("be", yyyyDash);
CHROME_FORMATS_.put("en-CA", yyyyDash);
@@ -166,7 +163,6 @@
CHROME_FORMATS_.put("en-MT", ddSlash);
CHROME_FORMATS_.put("en-PH", ddSlash);
CHROME_FORMATS_.put("es-US", ddSlash);
- CHROME_FORMATS_.put("fr", ddSlash);
CHROME_FORMATS_.put("fr-CH", ddDot);
CHROME_FORMATS_.put("hr", ddDotBlankDot);
CHROME_FORMATS_.put("in", ddDot);
@@ -174,7 +170,6 @@
CHROME_FORMATS_.put("is", yyyyDash);
CHROME_FORMATS_.put("iw", ddDot);
CHROME_FORMATS_.put("ja-JP-u-ca-japanese", "平成yy/MM/dd");
- CHROME_FORMATS_.put("lv", yyyyDotDot);
CHROME_FORMATS_.put("mk", yyyyDash);
CHROME_FORMATS_.put("nl-BE", ddSlash);
CHROME_FORMATS_.put("sk", ddDotBlank);
@@ -218,7 +213,6 @@
IE_FORMATS_.put("ja-JP-u-ca-japanese", "\u200E平成\u200E \u200Eyy\u200E年\u200EMM\u200E月\u200Edd\u200E日");
IE_FORMATS_.put("ko", "\u200EYYYY\u200E\uB144 \u200EMM\u200E\uC6D4 \u200Edd\u200E\uC77C");
IE_FORMATS_.put("lt", yyyyDot);
- IE_FORMATS_.put("lv", yyyyDotDot);
IE_FORMATS_.put("mt", ddSlash);
IE_FORMATS_.put("nl-BE", ddSlash);
IE_FORMATS_.put("no", ddDot);
@@ -250,7 +244,7 @@
else if (browserVersion.isIE()) {
formats = IE_FORMATS_;
}
- else if (!browserVersion.isFirefox52()) {
+ else if (browserVersion.isFirefox52()) {
formats = FF_52_FORMATS_;
}
else {
Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/intl/DateTimeFormatTest.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/intl/DateTimeFormatTest.java 2018-06-16 06:29:17 UTC (rev 15323)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/intl/DateTimeFormatTest.java 2018-06-16 12:34:48 UTC (rev 15324)
@@ -17,6 +17,8 @@
import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.CHROME;
import static com.gargoylesoftware.htmlunit.BrowserRunner.TestedBrowser.FF;
+import org.apache.commons.lang3.CharUtils;
+import org.junit.ComparisonFailure;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -62,7 +64,23 @@
+ "</head><body onload='test()'>\n"
+ "</body></html>";
- loadPageWithAlerts2(html);
+ try {
+ loadPageWithAlerts2(html);
+ }
+ catch (final ComparisonFailure e) {
+ final String msg = e.getMessage();
+ for (int i = 0; i < msg.length(); i++) {
+ final char c = msg.charAt(i);
+ if (CharUtils.isAscii(c)) {
+ System.out.print(c);
+ }
+ else {
+ System.out.print(CharUtils.unicodeEscaped(c));
+ }
+ }
+ System.out.println();
+ throw e;
+ }
}
/**
@@ -89,8 +107,7 @@
* @throws Exception if the test fails
*/
@Test
- @Alerts(DEFAULT = "\u5e73\u621024/12/20",
- FF = "24/12/20",
+ @Alerts(DEFAULT = "24/12/20",
IE = "\u200e\u5e73\u6210\u200e\u0020\u200e24\u200e\u5e74\u200e12\u200e\u6708\u200e20\u200e\u65e5")
public void format_ja_jp_u_ca_japanese() throws Exception {
test("new Intl.DateTimeFormat('ja-JP-u-ca-japanese').format(date)");
@@ -103,6 +120,7 @@
*/
@Test
@Alerts(DEFAULT = "20.12.2012",
+ FF60 = "12/20/2012",
IE = "\u200E12\u200E/\u200E20\u200E/\u200E2012")
public void format_ban() throws Exception {
test("new Intl.DateTimeFormat('ban').format(date)");
@@ -222,7 +240,10 @@
* @throws Exception if the test fails
*/
@Test
- @Alerts(DEFAULT = "\u0627\u0644\u062E\u0645\u064A\u0633\u060C \u0662\u0660 \u062F\u064A\u0633\u0645\u0628\u0631"
+ @Alerts(DEFAULT = "\u0627\u0644\u062e\u0645\u064a\u0633\u060c \u0662\u0660 \u062f\u064a\u0633\u0645\u0628\u0631"
+ + " \u0662\u0660\u0661\u0662 \u0645\u064a\u0644\u0627\u062f\u064a"
+ + " \u0664:\u0660\u0660:\u0660\u0660 \u0635",
+ FF52 = "\u0627\u0644\u062E\u0645\u064A\u0633\u060C \u0662\u0660 \u062F\u064A\u0633\u0645\u0628\u0631"
+ "\u060C \u0662\u0660\u0661\u0662 \u0645\u064A\u0644\u0627\u062F\u064A \u0664:\u0660\u0660:\u0660"
+ "\u0660 \u0635",
IE = "\u200F\u0627\u0644\u062E\u0645\u064A\u0633\u200F,"
@@ -242,6 +263,7 @@
@Test
@Alerts(DEFAULT = "Thursday, December 20, 2012, GMT",
CHROME = "Thursday, December 20, 2012, UTC",
+ FF60 = "Thursday, December 20, 2012, UTC",
IE = "\u200EThursday\u200E, \u200EDecember\u200E \u200E20\u200E, \u200E2012")
@NotYetImplemented
public void format_utc_short() throws Exception {
@@ -1367,7 +1389,7 @@
*/
@Test
@Alerts(DEFAULT = "2012-12-20",
- FF52 = "20/12/2012",
+ FF = "20/12/2012",
IE = "\u200E20\u200E/\u200E12\u200E/\u200E2012")
public void format_mt() throws Exception {
test("new Intl.DateTimeFormat('mt').format(date)");
@@ -1378,7 +1400,7 @@
*/
@Test
@Alerts(DEFAULT = "2012-12-20",
- FF52 = "20/12/2012",
+ FF = "20/12/2012",
IE = "\u200E20\u200E/\u200E12\u200E/\u200E2012")
public void format_mt_mt() throws Exception {
test("new Intl.DateTimeFormat('mt-MT').format(date)");
@@ -1399,7 +1421,6 @@
*/
@Test
@Alerts(DEFAULT = "20/12/2012",
- FF60 = "20-12-2012",
IE = "\u200E20\u200E/\u200E12\u200E/\u200E2012")
public void format_nl_be() throws Exception {
test("new Intl.DateTimeFormat('nl-BE').format(date)");
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop