From 6337d9067a5cc7f5e68f5f3fc1d938a175331172 Mon Sep 17 00:00:00 2001 From: Valery Yatsynovich Date: Sat, 25 Nov 2017 00:00:08 +0300 Subject: [PATCH] Remove unused "incrementMillis" field from TickingClock Signed-off-by: Alexei Barantsev --- .../openqa/selenium/lift/WebDriverTestContextTest.java | 2 +- .../org/openqa/selenium/support/PageFactoryTest.java | 2 +- .../org/openqa/selenium/support/ui/TickingClock.java | 5 ----- .../openqa/selenium/support/ui/WebDriverWaitTest.java | 10 +++++----- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/java/client/test/org/openqa/selenium/lift/WebDriverTestContextTest.java b/java/client/test/org/openqa/selenium/lift/WebDriverTestContextTest.java index 6586a3a1afb86..6581f090d0e68 100644 --- a/java/client/test/org/openqa/selenium/lift/WebDriverTestContextTest.java +++ b/java/client/test/org/openqa/selenium/lift/WebDriverTestContextTest.java @@ -64,7 +64,7 @@ public void createMocks() { element = mock(WebElement.class); element2 = mock(WebElement.class); finder = mockFinder(); - clock = new TickingClock(CLOCK_INCREMENT); + clock = new TickingClock(); } @Test diff --git a/java/client/test/org/openqa/selenium/support/PageFactoryTest.java b/java/client/test/org/openqa/selenium/support/PageFactoryTest.java index ad1118e3ab465..eb7557d807009 100644 --- a/java/client/test/org/openqa/selenium/support/PageFactoryTest.java +++ b/java/client/test/org/openqa/selenium/support/PageFactoryTest.java @@ -190,7 +190,7 @@ public void shouldNotThrowANoSuchElementExceptionWhenUsedWithAFluentWait() { driver = mock(WebDriver.class); when(driver.findElement(Mockito.any())).thenThrow(new NoSuchElementException("because")); - TickingClock clock = new TickingClock(10); + TickingClock clock = new TickingClock(); Wait wait = new WebDriverWait(driver, clock, clock, 1, 1001); PublicPage page = new PublicPage(); diff --git a/java/client/test/org/openqa/selenium/support/ui/TickingClock.java b/java/client/test/org/openqa/selenium/support/ui/TickingClock.java index 000abd3fde121..69066d46de650 100644 --- a/java/client/test/org/openqa/selenium/support/ui/TickingClock.java +++ b/java/client/test/org/openqa/selenium/support/ui/TickingClock.java @@ -20,13 +20,8 @@ import java.util.concurrent.TimeUnit; public class TickingClock implements Clock, Sleeper { - private final long incrementMillis; private long now = 0; - public TickingClock(long incrementMillis) { - this.incrementMillis = incrementMillis; - } - public long now() { return now; } diff --git a/java/client/test/org/openqa/selenium/support/ui/WebDriverWaitTest.java b/java/client/test/org/openqa/selenium/support/ui/WebDriverWaitTest.java index 6eeecd1b09d83..f00a19d194b73 100644 --- a/java/client/test/org/openqa/selenium/support/ui/WebDriverWaitTest.java +++ b/java/client/test/org/openqa/selenium/support/ui/WebDriverWaitTest.java @@ -71,7 +71,7 @@ public void shouldIncludeRemoteInfoForWrappedDriverTimeout() throws IOException WebDriver testDriver = mock(WebDriver.class, withSettings().extraInterfaces(WrapsDriver.class)); when(((WrapsDriver) testDriver).getWrappedDriver()).thenReturn(driver); - TickingClock clock = new TickingClock(200); + TickingClock clock = new TickingClock(); WebDriverWait wait = new WebDriverWait(testDriver, clock, clock, 1, 200); Throwable ex = catchThrowable(() -> wait.until((d) -> false)); @@ -83,7 +83,7 @@ public void shouldIncludeRemoteInfoForWrappedDriverTimeout() throws IOException @Test public void shouldThrowAnExceptionIfTheTimerRunsOut() { - TickingClock clock = new TickingClock(200); + TickingClock clock = new TickingClock(); WebDriverWait wait = new WebDriverWait(mockDriver, clock, clock, 1, 200); Throwable ex = catchThrowable(() -> wait.until((d) -> false)); @@ -99,7 +99,7 @@ public void shouldSilentlyCaptureNoSuchElementExceptions() { .thenThrow(new NoSuchElementException("foo")) .thenReturn(mockElement); - TickingClock clock = new TickingClock(500); + TickingClock clock = new TickingClock(); Wait wait = new WebDriverWait(mockDriver, clock, clock, 5, 500); assertSame(mockElement, wait.until(condition)); } @@ -112,7 +112,7 @@ public void shouldSilentlyCaptureNoSuchFrameExceptions() { .thenThrow(new NoSuchFrameException("foo")) .thenReturn(mockElement); - TickingClock clock = new TickingClock(500); + TickingClock clock = new TickingClock(); Wait wait = new WebDriverWait(mockDriver, clock, clock, 5, 500); wait.until(condition); } @@ -126,7 +126,7 @@ public void shouldSilentlyCaptureNoSuchWindowExceptions() { .thenThrow(new NoSuchWindowException("foo")) .thenReturn(mockElement); - TickingClock clock = new TickingClock(500); + TickingClock clock = new TickingClock(); Wait wait = new WebDriverWait(mockDriver, clock, clock, 5, 500); wait.until(condition); }