summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQasid Sadiq <qasid@google.com>2018-06-21 14:31:51 -0700
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-06-26 23:44:17 +0000
commit8c594981ee154508e5e24c210d9c30ef9e4ee35f (patch)
tree382c23c12a3548ffef42a352414801134c6ab53c
parentca9d167c53d093ab09ba978bfed23ef756764b3f (diff)
downloadcts-8c594981ee154508e5e24c210d9c30ef9e4ee35f.tar.gz
Remove failing text traveral tests
They are blocking P, and they are testing something that should be deprecated. Bug: 110266107 Test: Built and ran tests in file. Change-Id: I10bbe230e585726969d2a3578dfbdf7da72a796d (cherry picked from commit 20523ea303f48fd18811c13bd0e6c422fffc86db)
-rw-r--r--tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityTextTraversalTest.java156
1 files changed, 0 insertions, 156 deletions
diff --git a/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityTextTraversalTest.java b/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityTextTraversalTest.java
index d0bab511617..588827379f4 100644
--- a/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityTextTraversalTest.java
+++ b/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityTextTraversalTest.java
@@ -2970,162 +2970,6 @@ public class AccessibilityTextTraversalTest
}
@MediumTest
- public void testActionNextAndPreviousAtGranularityPageOverText() throws Exception {
- final EditText editText = (EditText) getActivity().findViewById(R.id.edit);
-
- getInstrumentation().runOnMainSync(new Runnable() {
- @Override
- public void run() {
- editText.setVisibility(View.VISIBLE);
- editText.setText(getString(R.string.android_wiki));
- Selection.removeSelection(editText.getText());
- }
- });
-
- final AccessibilityNodeInfo text = getInstrumentation().getUiAutomation()
- .getRootInActiveWindow().findAccessibilityNodeInfosByText(getString(
- R.string.android_wiki)).get(0);
-
- final int granularities = text.getMovementGranularities();
- assertEquals(granularities, AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER
- | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_WORD
- | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE
- | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH
- | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE);
-
- final Bundle arguments = new Bundle();
- arguments.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT,
- AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE);
-
- // Move forward a few pages
- for (int i = 0; i < CHARACTER_INDICES_OF_PAGE_START.length - 1; i++) {
- AccessibilityEvent event = performMovementActionAndGetEvent(
- text,
- AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY,
- AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE,
- false);
- assertEquals(event.getClassName(), EditText.class.getName());
- assertTrue("Event should contain text", event.getText().size() > 0);
- assertTrue("Event text doesn't match. Expected: " + getString(R.string.android_wiki)
- + ". Received:" + event.getText().get(0),
- TextUtils.equals(event.getText().get(0), getString(R.string.android_wiki)));
- assertEquals("Event from should be start of text skipped.",
- CHARACTER_INDICES_OF_PAGE_START[i], event.getFromIndex());
- assertEquals("Event to should be end of text skipped.",
- CHARACTER_INDICES_OF_PAGE_START[i + 1], event.getToIndex());
- // Verify the selection position has changed.
- assertEquals("Event selection start should match position it moved to.",
- CHARACTER_INDICES_OF_PAGE_START[i + 1],
- Selection.getSelectionStart(editText.getText()));
- assertEquals("Event selection end should match position it moved to.",
- CHARACTER_INDICES_OF_PAGE_START[i + 1],
- Selection.getSelectionEnd(editText.getText()));
- }
-
- // Move back to the beginning
- for (int i = CHARACTER_INDICES_OF_PAGE_START.length - 2; i >= 0; i--) {
- AccessibilityEvent event = performMovementActionAndGetEvent(
- text,
- AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY,
- AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE,
- false);
- assertEquals(event.getClassName(), EditText.class.getName());
- assertTrue("Event should contain text", event.getText().size() > 0);
- assertTrue("Event text doesn't match. Expected: " + getString(R.string.android_wiki)
- + ". Received:" + event.getText().get(0),
- TextUtils.equals(event.getText().get(0), getString(R.string.android_wiki)));
- assertEquals("Event from should be start of text skipped.",
- CHARACTER_INDICES_OF_PAGE_START[i], event.getFromIndex());
- assertEquals("Event to should be end of text skipped.",
- CHARACTER_INDICES_OF_PAGE_START[i + 1], event.getToIndex());
- // Verify the selection position has changed.
- assertEquals("Event selection start should match position it moved to.",
- CHARACTER_INDICES_OF_PAGE_START[i],
- Selection.getSelectionStart(editText.getText()));
- assertEquals("Event selection end should match position it moved to.",
- CHARACTER_INDICES_OF_PAGE_START[i],
- Selection.getSelectionEnd(editText.getText()));
- }
- }
-
- @MediumTest
- public void testActionNextAndPreviousAtGranularityPageOverTextExtend() throws Exception {
- final EditText editText = (EditText) getActivity().findViewById(R.id.edit);
-
- getInstrumentation().runOnMainSync(new Runnable() {
- @Override
- public void run() {
- editText.setVisibility(View.VISIBLE);
- editText.setText(getString(R.string.android_wiki));
- Selection.removeSelection(editText.getText());
- }
- });
-
- final AccessibilityNodeInfo text = getInstrumentation().getUiAutomation()
- .getRootInActiveWindow().findAccessibilityNodeInfosByText(getString(
- R.string.android_wiki)).get(0);
-
- final int granularities = text.getMovementGranularities();
- assertEquals(granularities, AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER
- | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_WORD
- | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_LINE
- | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH
- | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE);
-
- final Bundle arguments = new Bundle();
- arguments.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT,
- AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE);
-
- // Move forward a few pages
- for (int i = 0; i < CHARACTER_INDICES_OF_PAGE_START.length - 1; i++) {
- AccessibilityEvent event = performMovementActionAndGetEvent(
- text,
- AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY,
- AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE,
- true);
- assertEquals(event.getClassName(), EditText.class.getName());
- assertTrue("Event should contain text", event.getText().size() > 0);
- assertTrue("Event text doesn't match. Expected: " + getString(R.string.android_wiki)
- + ". Received:" + event.getText().get(0),
- TextUtils.equals(event.getText().get(0), getString(R.string.android_wiki)));
- assertEquals("Event from should be start of text skipped",
- CHARACTER_INDICES_OF_PAGE_START[i], event.getFromIndex());
- assertEquals("Event to should be end of text skipped",
- CHARACTER_INDICES_OF_PAGE_START[i + 1], event.getToIndex());
- // Verify the selection position has changed.
- assertEquals("Event selection start should stay at beginning",
- 0, Selection.getSelectionStart(editText.getText()));
- assertEquals("Event selection end should match current position",
- CHARACTER_INDICES_OF_PAGE_START[i + 1],
- Selection.getSelectionEnd(editText.getText()));
- }
-
- // Move back to the beginning
- for (int i = CHARACTER_INDICES_OF_PAGE_START.length - 2; i >= 0; i--) {
- AccessibilityEvent event = performMovementActionAndGetEvent(
- text,
- AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY,
- AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE,
- true);
- assertEquals(event.getClassName(), EditText.class.getName());
- assertTrue("Event should contain text", event.getText().size() > 0);
- assertTrue("Event text doesn't match. Expected: " + getString(R.string.android_wiki)
- + ". Received:" + event.getText().get(0),
- TextUtils.equals(event.getText().get(0), getString(R.string.android_wiki)));
- assertEquals("Event from should be start of text skipped",
- CHARACTER_INDICES_OF_PAGE_START[i], event.getFromIndex());
- assertEquals("Event to should be end of text skipped",
- CHARACTER_INDICES_OF_PAGE_START[i + 1], event.getToIndex());
- // Verify the selection position has changed.
- assertEquals("Event selection start should stay at beginning",
- 0, Selection.getSelectionStart(editText.getText()));
- assertEquals("Event selection end should match current position",
- CHARACTER_INDICES_OF_PAGE_START[i],
- Selection.getSelectionEnd(editText.getText()));
- }
- }
-
- @MediumTest
public void testActionNextAndPreviousAtGranularityParagraphOverText() throws Exception {
final TextView textView = (TextView) getActivity().findViewById(R.id.edit);