Skip to content

Commit

Permalink
Quit setting timeouts to negative values. (SeleniumHQ#3570)
Browse files Browse the repository at this point in the history
W3C no longer supports setting timeouts to negative values.
This change either sets page load timeout to 300 seconds, or does not set it
all.
  • Loading branch information
DrMarcII authored and juangj committed Feb 23, 2017
1 parent 2dd47b0 commit 1e271a2
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions java/client/test/org/openqa/selenium/PageLoadingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -401,12 +401,8 @@ public void testShouldNotHangIfDocumentOpenCallIsNeverFollowedByDocumentCloseCal
@NoDriverAfterTest
@Test
public void testPageLoadTimeoutCanBeChanged() {
try {
testPageLoadTimeoutIsEnforced(2);
testPageLoadTimeoutIsEnforced(3);
} finally {
driver.manage().timeouts().pageLoadTimeout(-1, SECONDS);
}
testPageLoadTimeoutIsEnforced(2);
testPageLoadTimeoutIsEnforced(3);
}

@Ignore(value = {SAFARI, MARIONETTE},
Expand All @@ -419,7 +415,7 @@ public void testShouldTimeoutIfAPageTakesTooLongToLoad() {
try {
testPageLoadTimeoutIsEnforced(2);
} finally {
driver.manage().timeouts().pageLoadTimeout(-1, SECONDS);
driver.manage().timeouts().pageLoadTimeout(300, SECONDS);
}

// Load another page after get() timed out but before test HTTP server served previous page.
Expand Down Expand Up @@ -458,7 +454,7 @@ public void testShouldTimeoutIfAPageTakesTooLongToLoadAfterClick() {
assertThat(duration, greaterThan(2000));
assertThat(duration, lessThan(5000));
} finally {
driver.manage().timeouts().pageLoadTimeout(-1, SECONDS);
driver.manage().timeouts().pageLoadTimeout(300, SECONDS);
}

// Load another page after get() timed out but before test HTTP server served previous page.
Expand Down Expand Up @@ -493,7 +489,7 @@ public void testShouldTimeoutIfAPageTakesTooLongToRefresh() {
assertThat(duration, greaterThan(2000));
assertThat(duration, lessThan(5000));
} finally {
driver.manage().timeouts().pageLoadTimeout(-1, SECONDS);
driver.manage().timeouts().pageLoadTimeout(300, SECONDS);
}

// Load another page after get() timed out but before test HTTP server served previous page.
Expand All @@ -512,7 +508,7 @@ public void testShouldNotStopLoadingPageAfterTimeout() {
try {
testPageLoadTimeoutIsEnforced(1);
} finally {
driver.manage().timeouts().pageLoadTimeout(-1, SECONDS);
driver.manage().timeouts().pageLoadTimeout(300, SECONDS);
}

new WebDriverWait(driver, 30)
Expand Down

0 comments on commit 1e271a2

Please sign in to comment.