Quantcast

[HtmlUnit] SVN: [13717] 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: [13717] trunk/htmlunit/src

asashour-2
Revision: 13717
          http://sourceforge.net/p/htmlunit/code/13717
Author:   asashour
Date:     2017-03-13 16:53:17 +0000 (Mon, 13 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/WebDriverTestCase.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-13 13:43:14 UTC (rev 13716)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersion.java 2017-03-13 16:53:17 UTC (rev 13717)
@@ -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;
        }
@@ -70,7 +70,7 @@
            numeric = 56;
        }
        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-13 13:43:14 UTC (rev 13716)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserParameterizedRunner.java 2017-03-13 16:53:17 UTC (rev 13717)
@@ -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-13 13:43:14 UTC (rev 13716)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserRunner.java 2017-03-13 16:53:17 UTC (rev 13717)
@@ -75,6 +75,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));
                 }
@@ -89,6 +92,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));
             }
@@ -159,7 +165,10 @@
         FF,
 
         /** Firefox 45. */
-        FF45
+        FF45,
+
+        /** Firefox 52. */
+        FF52
     }
 
     /**
@@ -206,6 +215,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
          */
@@ -258,6 +273,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-13 13:43:14 UTC (rev 13716)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/BrowserVersionTest.java 2017-03-13 16:53:17 UTC (rev 13717)
@@ -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-13 13:43:14 UTC (rev 13716)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/NotYetImplementedTest.java 2017-03-13 16:53:17 UTC (rev 13717)
@@ -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++;
             }
@@ -217,27 +224,32 @@
         final StringBuilder overview = new StringBuilder();
         overview.append("<table class='bottomBorder'>\n");
         overview.append("  <tr>\n");
-        overview.append("    <td class='numeric'>").append(Integer.toString(count)).append("</td>\n");
+        overview.append("    <td class='numeric'>").append(count).append("</td>\n");
         overview.append("    <td>methods marked as NotYetImplemented</td>\n");
         overview.append("  </tr>\n");
 
         overview.append("  <tr>\n");
-        overview.append("    <td class='numeric'>").append(Integer.toString(countIE)).append("</td>\n");
+        overview.append("    <td class='numeric'>").append(countIE).append("</td>\n");
         overview.append("    <td>for IE</td>\n");
         overview.append("  </tr>\n");
 
         overview.append("  <tr>\n");
-        overview.append("    <td class='numeric'>").append(Integer.toString(countFF45)).append("</td>\n");
+        overview.append("    <td class='numeric'>").append(countFF45).append("</td>\n");
         overview.append("    <td>for FF45</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 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(countChrome).append("</td>\n");
         overview.append("    <td>for Chrome</td>\n");
         overview.append("  </tr>\n");
 
         overview.append("  <tr>\n");
-        overview.append("    <td class='numeric'>").append(Integer.toString(countEdge)).append("</td>\n");
+        overview.append("    <td class='numeric'>").append(countEdge).append("</td>\n");
         overview.append("    <td>for Edge</td>\n");
         overview.append("  </tr>\n");
 

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebDriverTestCase.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebDriverTestCase.java 2017-03-13 13:43:14 UTC (rev 13716)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebDriverTestCase.java 2017-03-13 16:53:17 UTC (rev 13717)
@@ -89,7 +89,7 @@
  * <pre>
    browsers=hu,ff45,ie
    chrome.bin=/path/to/chromedriver                     [Unix-like]
-   ff45.bin=/usr/bin/firefox                            [Unix-like]
+   ff52.bin=/usr/bin/firefox                            [Unix-like]
    ie.bin=C:\\path\\to\\32bit\\IEDriverServer.exe       [Windows]
    edge.bin=C:\\path\\to\\MicrosoftWebDriver.exe        [Windows]
    autofix=true
@@ -97,11 +97,12 @@
  * The file could contain some properties:
  * <ul>
  *   <li>browsers: is a comma separated list contains any combination of "hu" (for HtmlUnit with all browser versions),
- *   "hu-ie", "hu-ff45", "ff45", "ie", "chrome", which will be used to drive real browsers</li>
+ *   "hu-ie", "hu-ff52", "ff52", "ie", "chrome", which will be used to drive real browsers</li>
  *
  *   <li>chrome.bin (mandatory if it does not exist in the <i>path</i>): is the location of the ChromeDriver binary (see
  *   <a href="http://chromedriver.storage.googleapis.com/index.html">Chrome Driver downloads</a>)</li>
  *   <li>ff45.bin (optional): is the location of the FF binary, in Windows use double back-slashes</li>
+ *   <li>ff52.bin (optional): is the location of the FF binary, in Windows use double back-slashes</li>
  *   <li>ie.bin (mandatory if it does not exist in the <i>path</i>): is the location of the IEDriverServer binary (see
  *   <a href="http://selenium-release.storage.googleapis.com/index.html">IEDriverServer downloads</a>)</li>
  *   <li>edge.bin (mandatory if it does not exist in the <i>path</i>): is the location of the MicrosoftWebDriver binary
@@ -142,6 +143,7 @@
     private static String EDGE_BIN_;
     private static String IE_BIN_;
     private static String FF45_BIN_;
+    private static String FF52_BIN_;
 
     /** The driver cache. */
     protected static final Map<BrowserVersion, WebDriver> WEB_DRIVERS_ = new HashMap<>();
@@ -194,6 +196,7 @@
                     EDGE_BIN_ = properties.getProperty("edge.bin");
                     IE_BIN_ = properties.getProperty("ie.bin");
                     FF45_BIN_ = properties.getProperty("ff45.bin");
+                    FF52_BIN_ = properties.getProperty("ff52.bin");
 
                     final boolean autofix = Boolean.parseBoolean(properties.getProperty("autofix"));
                     System.setProperty(AUTOFIX_, Boolean.toString(autofix));
@@ -449,6 +452,15 @@
                 return new FirefoxDriver();
             }
 
+            if (BrowserVersion.FIREFOX_52 == getBrowserVersion()) {
+                if (FF52_BIN_ != null) {
+                    final FirefoxOptions options = new FirefoxOptions();
+                    options.setBinary(FF52_BIN_);
+                    return new FirefoxDriver(options);
+                }
+                return new FirefoxDriver();
+            }
+
             throw new RuntimeException("Unexpected BrowserVersion: " + getBrowserVersion());
         }
         if (webDriver_ == null) {
@@ -460,7 +472,7 @@
     }
 
     private static String getBrowserName(final BrowserVersion browserVersion) {
-        if (browserVersion == BrowserVersion.FIREFOX_45) {
+        if (browserVersion == BrowserVersion.FIREFOX_45 || browserVersion == BrowserVersion.FIREFOX_52) {
             return BrowserType.FIREFOX;
         }
         if (browserVersion == BrowserVersion.INTERNET_EXPLORER) {

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-13 13:43:14 UTC (rev 13716)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/runners/BrowserStatement.java 2017-03-13 16:53:17 UTC (rev 13717)
@@ -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-13 13:43:14 UTC (rev 13716)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/runners/BrowserVersionClassRunner.java 2017-03-13 16:53:17 UTC (rev 13717)
@@ -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());
                 }
@@ -276,6 +282,12 @@
                     }
                     break;
 
+                case FF52:
+                    if (browserVersion_ == BrowserVersion.FIREFOX_52) {
+                        return true;
+                    }
+                    break;
+
                 case CHROME:
                     if (browserVersion_.isChrome()) {
                         return true;


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