Skip to content

Commit 1e271a2

Browse files
DrMarcIIjuangj
authored andcommitted
Quit setting timeouts to negative values. (#3570)
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.
1 parent 2dd47b0 commit 1e271a2

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

java/client/test/org/openqa/selenium/PageLoadingTest.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -401,12 +401,8 @@ public void testShouldNotHangIfDocumentOpenCallIsNeverFollowedByDocumentCloseCal
401401
@NoDriverAfterTest
402402
@Test
403403
public void testPageLoadTimeoutCanBeChanged() {
404-
try {
405-
testPageLoadTimeoutIsEnforced(2);
406-
testPageLoadTimeoutIsEnforced(3);
407-
} finally {
408-
driver.manage().timeouts().pageLoadTimeout(-1, SECONDS);
409-
}
404+
testPageLoadTimeoutIsEnforced(2);
405+
testPageLoadTimeoutIsEnforced(3);
410406
}
411407

412408
@Ignore(value = {SAFARI, MARIONETTE},
@@ -419,7 +415,7 @@ public void testShouldTimeoutIfAPageTakesTooLongToLoad() {
419415
try {
420416
testPageLoadTimeoutIsEnforced(2);
421417
} finally {
422-
driver.manage().timeouts().pageLoadTimeout(-1, SECONDS);
418+
driver.manage().timeouts().pageLoadTimeout(300, SECONDS);
423419
}
424420

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

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

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

518514
new WebDriverWait(driver, 30)

0 commit comments

Comments
 (0)