diff options
author | Kevin Jin <kjin@google.com> | 2013-07-11 16:35:40 -0700 |
---|---|---|
committer | Kevin Jin <kjin@google.com> | 2013-07-11 16:35:40 -0700 |
commit | ce3d103d2784040f32d1a97b848d58a1c9592a15 (patch) | |
tree | 5e2a24af99a1aa2173efe9e4c1077d92500135db /src/com | |
parent | df778b5b087c324e1078c6ba692d0aff4f940ac9 (diff) | |
download | droiddriver-ce3d103d2784040f32d1a97b848d58a1c9592a15.tar.gz |
remove versions of check* with custom timeouts
Change-Id: Ic4ac93d5f9694747cb0381673cc8004ad150ea80
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/google/android/droiddriver/DroidDriver.java | 40 | ||||
-rw-r--r-- | src/com/google/android/droiddriver/base/AbstractDroidDriver.java | 24 |
2 files changed, 16 insertions, 48 deletions
diff --git a/src/com/google/android/droiddriver/DroidDriver.java b/src/com/google/android/droiddriver/DroidDriver.java index b50e48d..e57ccb6 100644 --- a/src/com/google/android/droiddriver/DroidDriver.java +++ b/src/com/google/android/droiddriver/DroidDriver.java @@ -32,27 +32,6 @@ public interface DroidDriver { boolean has(Finder finder, long timeoutMillis); /** - * Polls until a {@link UiElement} is found using the given finder, or the - * default timeout is reached. - * - * @param finder The matching mechanism - * @throws TimeoutException If matching element does not appear within the - * default timeout - */ - void checkExists(Finder finder); - - /** - * Polls until a {@link UiElement} is found using the given finder, or - * {@code timeoutMillis} is reached. - * - * @param finder The matching mechanism - * @param timeoutMillis The ad-hoc timeout for this method - * @throws TimeoutException If matching element does not appear within - * {@code timeoutMillis} - */ - void checkExists(Finder finder, long timeoutMillis); - - /** * Returns the first {@link UiElement} found using the given finder. This * method will poll until a match is found, or the default timeout is reached. * <p> @@ -79,25 +58,24 @@ public interface DroidDriver { UiElement find(Finder finder); /** - * Polls until the {@link UiElement} found using the given finder is gone, or - * the default timeout is reached. + * Polls until a {@link UiElement} is found using the given finder, or the + * default timeout is reached. * * @param finder The matching mechanism - * @throws TimeoutException If matching element is not gone within the default - * timeout + * @throws TimeoutException If matching element does not appear within the + * default timeout */ - void checkGone(Finder finder); + void checkExists(Finder finder); /** * Polls until the {@link UiElement} found using the given finder is gone, or - * {@code timeoutMillis} is reached. + * the default timeout is reached. * * @param finder The matching mechanism - * @param timeoutMillis The ad-hoc timeout for this method - * @throws TimeoutException If matching element is not gone within - * {@code timeoutMillis} + * @throws TimeoutException If matching element is not gone within the default + * timeout */ - void checkGone(Finder finder, long timeoutMillis); + void checkGone(Finder finder); /** * Returns the {@link Poller}. diff --git a/src/com/google/android/droiddriver/base/AbstractDroidDriver.java b/src/com/google/android/droiddriver/base/AbstractDroidDriver.java index d03073d..51fdaa7 100644 --- a/src/com/google/android/droiddriver/base/AbstractDroidDriver.java +++ b/src/com/google/android/droiddriver/base/AbstractDroidDriver.java @@ -100,7 +100,7 @@ public abstract class AbstractDroidDriver implements DroidDriver, Screenshotter @Override public boolean has(Finder finder, long timeoutMillis) { try { - checkExists(finder, timeoutMillis); + getPoller().pollFor(this, finder, EXISTS, timeoutMillis); return true; } catch (TimeoutException e) { return false; @@ -108,31 +108,21 @@ public abstract class AbstractDroidDriver implements DroidDriver, Screenshotter } @Override - public void checkExists(Finder finder) { - checkExists(finder, getPoller().getTimeoutMillis()); - } - - @Override - public void checkExists(Finder finder, long timeoutMillis) { - Logs.call(this, "checkExists", finder, timeoutMillis); - getPoller().pollFor(this, finder, EXISTS, timeoutMillis); - } - - @Override public UiElement on(Finder finder) { Logs.call(this, "on", finder); return getPoller().pollFor(this, finder, EXISTS); } @Override - public void checkGone(Finder finder) { - checkGone(finder, getPoller().getTimeoutMillis()); + public void checkExists(Finder finder) { + Logs.call(this, "checkExists", finder); + getPoller().pollFor(this, finder, EXISTS); } @Override - public void checkGone(Finder finder, long timeoutMillis) { - Logs.call(this, "checkGone", finder, timeoutMillis); - getPoller().pollFor(this, finder, GONE, timeoutMillis); + public void checkGone(Finder finder) { + Logs.call(this, "checkGone", finder); + getPoller().pollFor(this, finder, GONE); } @Override |