[HtmlUnit] SVN: [13770] trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ javascript/host/html/HTMLImageElementTest.java

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: [13770] trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ javascript/host/html/HTMLImageElementTest.java

rbri
Revision: 13770
          http://sourceforge.net/p/htmlunit/code/13770
Author:   rbri
Date:     2017-03-15 21:02:35 +0000 (Wed, 15 Mar 2017)
Log Message:
-----------
Fix HTMLImageElementTest.complete

Modified Paths:
--------------
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLImageElementTest.java

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLImageElementTest.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLImageElementTest.java 2017-03-15 20:54:09 UTC (rev 13769)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLImageElementTest.java 2017-03-15 21:02:35 UTC (rev 13770)
@@ -29,6 +29,7 @@
 import org.openqa.selenium.By;
 import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.WebElement;
+import org.openqa.selenium.htmlunit.HtmlUnitDriver;
 
 import com.gargoylesoftware.htmlunit.BrowserRunner;
 import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts;
@@ -601,7 +602,6 @@
             + "<script>\n"
             + "  function showInfo(imageId) {\n"
             + "    var img = document.getElementById(imageId);\n"
-            + "    img.width;\n" // this forces image loading in htmlunit
             + "    alert(img.complete);\n"
             + "  }\n"
             + "  function test() {\n"
@@ -617,6 +617,10 @@
             + "  <img id='myImage3' src='" + URL_SECOND + "'>\n"
             + "  <img id='myImage4' src='" + URL_SECOND + "img.jpg'>\n"
             + "</body></html>";
+        final WebDriver driver = getWebDriver();
+        if (driver instanceof HtmlUnitDriver) {
+            ((HtmlUnitDriver) driver).setDownloadImages(true);
+        }
 
         loadPageWithAlerts2(html);
     }


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