summaryrefslogtreecommitdiffstats
path: root/core/tests
diff options
context:
space:
mode:
authorSvetoslav Ganov <svetoslavganov@google.com>2012-02-07 12:07:23 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-02-07 12:07:23 -0800
commitd36ad9b1ff99675dd0eca6a3fda1f52353f451a4 (patch)
treed68f9eabc083d382fbda52fa9c1c0bca890c46c4 /core/tests
parente7171effdf9ef0700782520187c0a292b0a74759 (diff)
parentb765db590ff824fb5827fb773b14ac4286ae2774 (diff)
downloadframeworks_base-d36ad9b1ff99675dd0eca6a3fda1f52353f451a4.zip
frameworks_base-d36ad9b1ff99675dd0eca6a3fda1f52353f451a4.tar.gz
frameworks_base-d36ad9b1ff99675dd0eca6a3fda1f52353f451a4.tar.bz2
Merge "Adding a method for retching the root node in UiTestAutomationBridge"
Diffstat (limited to 'core/tests')
-rw-r--r--core/tests/coretests/src/android/accessibilityservice/InterrogationActivityTest.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/core/tests/coretests/src/android/accessibilityservice/InterrogationActivityTest.java b/core/tests/coretests/src/android/accessibilityservice/InterrogationActivityTest.java
index fa48093..2fb4237 100644
--- a/core/tests/coretests/src/android/accessibilityservice/InterrogationActivityTest.java
+++ b/core/tests/coretests/src/android/accessibilityservice/InterrogationActivityTest.java
@@ -430,4 +430,35 @@ public class InterrogationActivityTest
}
}
}
+
+ @LargeTest
+ public void testGetRootAccessibilityNodeInfoInActiveWindow() throws Exception {
+ final long startTimeMillis = SystemClock.uptimeMillis();
+ try {
+ // get the root via the designated API
+ AccessibilityNodeInfo fetched = mUiTestAutomationBridge
+ .getRootAccessibilityNodeInfoInActiveWindow();
+ assertNotNull(fetched);
+
+ // get the root via traversal
+ AccessibilityNodeInfo expected = mUiTestAutomationBridge
+ .findAccessibilityNodeInfoByViewIdInActiveWindow(R.id.root);
+ while (true) {
+ AccessibilityNodeInfo parent = expected.getParent();
+ if (parent == null) {
+ break;
+ }
+ expected = parent;
+ }
+ assertNotNull(expected);
+
+ assertEquals("The node with id \"root\" should be the root.", expected, fetched);
+ } finally {
+ if (DEBUG) {
+ final long elapsedTimeMillis = SystemClock.uptimeMillis() - startTimeMillis;
+ Log.i(LOG_TAG, "testGetRootAccessibilityNodeInfoInActiveWindow: "
+ + elapsedTimeMillis + "ms");
+ }
+ }
+ }
}