[HtmlUnit] SVN: [13791] trunk/htmlunit/src

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: [13791] trunk/htmlunit/src

asashour-2
Revision: 13791
          http://sourceforge.net/p/htmlunit/code/13791
Author:   asashour
Date:     2017-03-16 08:49:23 +0000 (Thu, 16 Mar 2017)
Log Message:
-----------
Firefox 52

Modified Paths:
--------------
    trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersion.java
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserParameterizedRunner.java
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserRunner.java
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserVersionTest.java
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/NotYetImplementedTest.java
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/runners/BrowserStatement.java
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/runners/BrowserVersionClassRunner.java

Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersion.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersion.java 2017-03-16 08:41:31 UTC (rev 13790)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersion.java 2017-03-16 08:49:23 UTC (rev 13791)
@@ -59,7 +59,7 @@
        var isMicrosoft = navigator.appVersion.indexOf('Trident/') != -1;
        var isEdge = navigator.appVersion.indexOf('Edge') != -1;
        var isChrome = navigator.appVersion.indexOf('Chrome') != -1;
-       var numeric = 45;
+       var numeric = 52;
        if (isMicrosoft) {
            numeric = 11;
        }
@@ -67,10 +67,10 @@
            numeric = 13;
        }
        else if (isChrome) {
-           numeric = 56;
+           numeric = 57;
        }
        pre.innerHTML = pre.innerHTML.replace('NUMERIC', numeric);
-       var browser = "FIREFOX_45";
+       var browser = "FIREFOX_52";
        if (isMicrosoft) {
            browser = "INTERNET_EXPLORER";
        }
@@ -124,6 +124,15 @@
         "Mozilla/5.0 (Windows NT 6.1; rv:45.0) Gecko/20100101 Firefox/45.0",
         45, "FF45", null);
 
+    /**
+     * Firefox 52 ESR.
+     * @since 2.26
+     */
+    public static final BrowserVersion FIREFOX_52 = new BrowserVersion(
+        NETSCAPE, "5.0 (Windows)",
+        "Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Firefox/52.0",
+        52, "FF52", null);
+
     /** Internet Explorer 11. */
     public static final BrowserVersion INTERNET_EXPLORER = new BrowserVersion(
         NETSCAPE, "5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko",
@@ -166,6 +175,17 @@
         FIREFOX_45.setImgAcceptHeader("image/png,image/*;q=0.8,*/*;q=0.5");
         FIREFOX_45.setCssAcceptHeader("text/css,*/*;q=0.1");
 
+        // FF52
+        FIREFOX_52.initDefaultFeatures();
+        FIREFOX_52.setVendor("");
+        FIREFOX_52.buildId_ = "20170303022339";
+        FIREFOX_52.setHeaderNamesOrdered(new String[] {
+            "Host", "User-Agent", "Accept", "Accept-Language", "Accept-Encoding", "Referer", "Cookie", "Connection"});
+        FIREFOX_52.setHtmlAcceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
+        FIREFOX_52.setXmlHttpRequestAcceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
+        FIREFOX_52.setImgAcceptHeader("image/png,image/*;q=0.8,*/*;q=0.5");
+        FIREFOX_52.setCssAcceptHeader("text/css,*/*;q=0.1");
+
         // IE
         INTERNET_EXPLORER.initDefaultFeatures();
         INTERNET_EXPLORER.setVendor("");

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserParameterizedRunner.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserParameterizedRunner.java 2017-03-16 08:41:31 UTC (rev 13790)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserParameterizedRunner.java 2017-03-16 08:49:23 UTC (rev 13791)
@@ -139,6 +139,10 @@
                     runners_.add(new BrowserVersionClassRunnerWithParameters(
                             klass, BrowserVersion.FIREFOX_45, true, tests));
                 }
+                if (browsers.contains("ff52")) {
+                    runners_.add(new BrowserVersionClassRunnerWithParameters(
+                            klass, BrowserVersion.FIREFOX_52, true, tests));
+                }
                 if (browsers.contains("ie")) {
                     runners_.add(new BrowserVersionClassRunnerWithParameters(
                             klass, BrowserVersion.INTERNET_EXPLORER, true, tests));
@@ -157,6 +161,10 @@
                 runners_.add(new BrowserVersionClassRunnerWithParameters(
                         klass, BrowserVersion.FIREFOX_45, false, tests));
             }
+            if (browsers.contains("hu-ff52")) {
+                runners_.add(new BrowserVersionClassRunnerWithParameters(
+                        klass, BrowserVersion.FIREFOX_52, false, tests));
+            }
             if (browsers.contains("hu-ie")) {
                 runners_.add(new BrowserVersionClassRunnerWithParameters(
                         klass, BrowserVersion.INTERNET_EXPLORER, false, tests));

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserRunner.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserRunner.java 2017-03-16 08:41:31 UTC (rev 13790)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserRunner.java 2017-03-16 08:49:23 UTC (rev 13791)
@@ -80,6 +80,9 @@
                 if (browsers.contains("ff45")) {
                     runners_.add(new BrowserVersionClassRunner(klass, BrowserVersion.FIREFOX_45, true));
                 }
+                if (browsers.contains("ff52")) {
+                    runners_.add(new BrowserVersionClassRunner(klass, BrowserVersion.FIREFOX_52, true));
+                }
                 if (browsers.contains("ie")) {
                     runners_.add(new BrowserVersionClassRunner(klass, BrowserVersion.INTERNET_EXPLORER, true));
                 }
@@ -94,6 +97,9 @@
             if (browsers.contains("hu-ff45")) {
                 runners_.add(new BrowserVersionClassRunner(klass, BrowserVersion.FIREFOX_45, false));
             }
+            if (browsers.contains("hu-ff52")) {
+                runners_.add(new BrowserVersionClassRunner(klass, BrowserVersion.FIREFOX_52, false));
+            }
             if (browsers.contains("hu-ie")) {
                 runners_.add(new BrowserVersionClassRunner(klass, BrowserVersion.INTERNET_EXPLORER, false));
             }
@@ -164,7 +170,10 @@
         FF,
 
         /** Firefox 45. */
-        FF45
+        FF45,
+
+        /** Firefox 52. */
+        FF42
     }
 
     /**
@@ -211,6 +220,12 @@
         String[] FF45() default { EMPTY_DEFAULT };
 
         /**
+         * Alerts for Firefox 52. If not defined, {@link #FF()} is used.
+         * @return the alerts
+         */
+        String[] FF52() default { EMPTY_DEFAULT };
+
+        /**
          * Alerts for latest Chrome.
          * @return the alerts
          */
@@ -263,6 +278,12 @@
         String[] FF45() default { EMPTY_DEFAULT };
 
         /**
+         * Alerts for Firefox 52. If not defined, {@link #FF()} is used.
+         * @return the alerts
+         */
+        String[] FF52() default { EMPTY_DEFAULT };
+
+        /**
          * Alerts for latest Chrome.
          * @return the alerts
          */

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserVersionTest.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserVersionTest.java 2017-03-16 08:41:31 UTC (rev 13790)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserVersionTest.java 2017-03-16 08:49:23 UTC (rev 13791)
@@ -32,6 +32,7 @@
     @Test
     public void getBrowserVersionNumeric() {
         assertEquals(45, BrowserVersion.FIREFOX_45.getBrowserVersionNumeric());
+        assertEquals(52, BrowserVersion.FIREFOX_52.getBrowserVersionNumeric());
         assertEquals(11, BrowserVersion.INTERNET_EXPLORER.getBrowserVersionNumeric());
         assertEquals(57, BrowserVersion.CHROME.getBrowserVersionNumeric());
         assertEquals(13, BrowserVersion.EDGE.getBrowserVersionNumeric());

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/NotYetImplementedTest.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/NotYetImplementedTest.java 2017-03-16 08:41:31 UTC (rev 13790)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/NotYetImplementedTest.java 2017-03-16 08:49:23 UTC (rev 13791)
@@ -151,6 +151,7 @@
         int count = 0;
         int countIE = 0;
         int countFF45 = 0;
+        int countFF52 = 0;
         int countChrome = 0;
         int countEdge = 0;
         for (final String entry : entries_) {
@@ -195,9 +196,14 @@
             if (browser.contains("FF45")) {
                 countFF45++;
             }
+            if (browser.contains("FF52")) {
+                countFF52++;
+            }
             if (!browser.contains("FF45")
+                    && !browser.contains("FF52")
                     && browser.contains("FF")) {
                 countFF45++;
+                countFF52++;
             }
             if (browser.contains("CHROME")) {
                 countChrome++;
@@ -208,6 +214,7 @@
             if (browser.contains("All")) {
                 countIE++;
                 countFF45++;
+                countFF52++;
                 countChrome++;
                 countEdge++;
             }
@@ -232,6 +239,11 @@
         overview.append("  </tr>\n");
 
         overview.append("  <tr>\n");
+        overview.append("    <td class='numeric'>").append(countFF52).append("</td>\n");
+        overview.append("    <td>for FF52</td>\n");
+        overview.append("  </tr>\n");
+
+        overview.append("  <tr>\n");
         overview.append("    <td class='numeric'>").append(Integer.toString(countChrome)).append("</td>\n");
         overview.append("    <td>for Chrome</td>\n");
         overview.append("  </tr>\n");

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/runners/BrowserStatement.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/runners/BrowserStatement.java 2017-03-16 08:41:31 UTC (rev 13790)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/runners/BrowserStatement.java 2017-03-16 08:49:23 UTC (rev 13791)
@@ -87,6 +87,7 @@
                 assertNotEquals(alerts.IE(), alerts.CHROME());
                 assertNotEquals(alerts.IE(), alerts.FF());
                 assertNotEquals(alerts.FF45(), alerts.FF());
+                assertNotEquals(alerts.FF52(), alerts.FF());
             }
         }
         final AlertsStandards alerts2 = method_.getAnnotation(AlertsStandards.class);
@@ -99,6 +100,7 @@
                 assertNotEquals(alerts2.IE(), alerts2.CHROME());
                 assertNotEquals(alerts2.IE(), alerts2.FF());
                 assertNotEquals(alerts2.FF45(), alerts2.FF());
+                assertNotEquals(alerts2.FF52(), alerts2.FF());
             }
         }
     }

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/runners/BrowserVersionClassRunner.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/runners/BrowserVersionClassRunner.java 2017-03-16 08:41:31 UTC (rev 13790)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/runners/BrowserVersionClassRunner.java 2017-03-16 08:49:23 UTC (rev 13791)
@@ -92,6 +92,9 @@
                 else if (browserVersion_ == BrowserVersion.FIREFOX_45) {
                     expectedAlerts = firstDefined(alerts.FF45(), alerts.FF(), alerts.DEFAULT());
                 }
+                else if (browserVersion_ == BrowserVersion.FIREFOX_52) {
+                    expectedAlerts = firstDefined(alerts.FF52(), alerts.FF(), alerts.DEFAULT());
+                }
                 else if (browserVersion_ == BrowserVersion.CHROME) {
                     expectedAlerts = firstDefined(alerts.CHROME(), alerts.DEFAULT());
                 }
@@ -117,6 +120,9 @@
                 else if (browserVersion_ == BrowserVersion.FIREFOX_45) {
                     expectedAlerts = firstDefined(alerts.FF45(), alerts.FF(), alerts.DEFAULT());
                 }
+                else if (browserVersion_ == BrowserVersion.FIREFOX_52) {
+                    expectedAlerts = firstDefined(alerts.FF52(), alerts.FF(), alerts.DEFAULT());
+                }
                 else if (browserVersion_ == BrowserVersion.CHROME) {
                     expectedAlerts = firstDefined(alerts.CHROME(), alerts.DEFAULT());
                 }


------------------------------------------------------------------------------
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...