diff options
author | Jake Slack <jaslack@google.com> | 2014-05-16 10:33:51 -0700 |
---|---|---|
committer | Jake Slack <jaslack@google.com> | 2014-05-16 10:33:51 -0700 |
commit | b4e825291041d963c5bda0349638565949d999f6 (patch) | |
tree | 2c6dc3286e95dd2d89c19b2132fd792f907073f9 /src | |
parent | 18e55387b4fc6b062d8630dd100be0cb58b03693 (diff) | |
download | droiddriver-b4e825291041d963c5bda0349638565949d999f6.tar.gz |
Roll back change to doScroll and add comment on why.
Change-Id: I3cbe232df929ca48bea81817a86782f9e1b684b4
Diffstat (limited to 'src')
-rw-r--r-- | src/com/google/android/droiddriver/scroll/AccessibilityEventScrollStepStrategy.java | 5 | ||||
-rw-r--r-- | src/com/google/android/droiddriver/uiautomation/UiAutomationElement.java | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/com/google/android/droiddriver/scroll/AccessibilityEventScrollStepStrategy.java b/src/com/google/android/droiddriver/scroll/AccessibilityEventScrollStepStrategy.java index 2406ef8..7929798 100644 --- a/src/com/google/android/droiddriver/scroll/AccessibilityEventScrollStepStrategy.java +++ b/src/com/google/android/droiddriver/scroll/AccessibilityEventScrollStepStrategy.java @@ -194,7 +194,10 @@ public class AccessibilityEventScrollStepStrategy implements ScrollStepStrategy @Override public void doScroll(final UiElement container, final PhysicalDirection direction) { - container.scroll(direction); + // We do not call container.scroll(direction) because container.scroll internally calls + // UiAutomation.executeAndWaitForEvent which clears the AccessibilityEvent Queue, preventing us + // from fetching the last accessibility event to determine if scrolling has finished. + SwipeAction.toScroll(direction).perform(container.getInjector(), container); } /** diff --git a/src/com/google/android/droiddriver/uiautomation/UiAutomationElement.java b/src/com/google/android/droiddriver/uiautomation/UiAutomationElement.java index 9a2b427..5d69814 100644 --- a/src/com/google/android/droiddriver/uiautomation/UiAutomationElement.java +++ b/src/com/google/android/droiddriver/uiautomation/UiAutomationElement.java @@ -175,6 +175,10 @@ public class UiAutomationElement extends BaseUiElement { return context.getInjector(); } + /** + * Note: The {@code UiAutomationElement} implementation of {@code doPerformAndWait} clears the + * {@code AccessibilityEvent} queue. + */ @Override protected void doPerformAndWait(final FutureTask<Boolean> futureTask, final long timeoutMillis) { context.callUiAutomation(new UiAutomationCallable<Void>() { |