[HtmlUnit] SVN: [15438] trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ WebDriverTestCase.java

rbri--- via HtmlUnit-develop <[email protected]>
Newsgroups gmane.comp.java.htmlunit.devel
Message-ID <[email protected]>
Revision: 15438
          http://sourceforge.net/p/htmlunit/code/15438
Author:   rbri
Date:     2018-07-06 08:09:44 +0000 (Fri, 06 Jul 2018)
Log Message:
-----------
try to make our test suite more robust

Modified Paths:
--------------
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebDriverTestCase.java

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebDriverTestCase.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebDriverTestCase.java	2018-07-05 07:35:45 UTC (rev 15437)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebDriverTestCase.java	2018-07-06 08:09:44 UTC (rev 15438)
@@ -1157,24 +1157,20 @@
      * @throws Exception in case of failure
      */
     protected void assertTitle(final WebDriver webdriver, final String expected) throws Exception {
-        if (useRealBrowser()) {
-            final long maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME;
+        final long maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME;
 
-            while (true) {
-                try {
-                    assertEquals(expected, webdriver.getTitle());
-                    break;
+        while (true) {
+            try {
+                assertEquals(expected, webdriver.getTitle());
+                return;
+            }
+            catch (final ComparisonFailure e) {
+                if (System.currentTimeMillis() > maxWait) {
+                    throw e;
                 }
-                catch (final ComparisonFailure e) {
-                    if (System.currentTimeMillis() > maxWait) {
-                        throw e;
-                    }
-                    Thread.sleep(10);
-                }
+                Thread.sleep(10);
             }
         }
-
-        assertEquals(expected, webdriver.getTitle());
     }
 
     /**


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.