summaryrefslogtreecommitdiff
path: root/tests/tests/widget/src/android/widget/cts/SpinnerTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tests/widget/src/android/widget/cts/SpinnerTest.java')
-rwxr-xr-xtests/tests/widget/src/android/widget/cts/SpinnerTest.java61
1 files changed, 0 insertions, 61 deletions
diff --git a/tests/tests/widget/src/android/widget/cts/SpinnerTest.java b/tests/tests/widget/src/android/widget/cts/SpinnerTest.java
index bca2bc72cfa..50ee3b1f4b8 100755
--- a/tests/tests/widget/src/android/widget/cts/SpinnerTest.java
+++ b/tests/tests/widget/src/android/widget/cts/SpinnerTest.java
@@ -403,34 +403,6 @@ public class SpinnerTest {
TestUtils.assertAllPixelsOfColor("Drop down should be blue", dropDownBackground,
dropDownBackground.getBounds().width(), dropDownBackground.getBounds().height(),
false, Color.BLUE, 1, true);
- waitForHasFocusMS(SPINNER_HAS_FOCUS_DELAY_MS);
- // Dismiss the popup with the emulated back key
- mInstrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_BACK);
- // Verify that we're not showing the popup
- PollingCheck.waitFor(() -> !mSpinnerDropdownMode.isPopupShowing());
-
- // Set yellow background on the popup
- mActivityRule.runOnUiThread(() ->
- mSpinnerDropdownMode.setPopupBackgroundDrawable(
- mActivity.getDrawable(R.drawable.yellow_fill)));
-
- // Use instrumentation to emulate a tap on the spinner to bring down its popup
- WidgetTestUtils.runOnMainAndDrawSync(mActivityRule, mSpinnerDropdownMode, () -> {
- mSpinnerDropdownMode.performClick();
- });
- // Verify that we're showing the popup
- PollingCheck.waitFor(() -> mSpinnerDropdownMode.isPopupShowing());
- // And test its fill
- dropDownBackground = mSpinnerDropdownMode.getPopupBackground();
- TestUtils.assertAllPixelsOfColor("Drop down should be yellow", dropDownBackground,
- dropDownBackground.getBounds().width(), dropDownBackground.getBounds().height(),
- false, Color.YELLOW, 1, true);
-
- waitForHasFocusMS(SPINNER_HAS_FOCUS_DELAY_MS);
- // Dismiss the popup with the emulated escape key
- mInstrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_ESCAPE);
- // Verify that we're not showing the popup
- PollingCheck.waitFor(() -> !mSpinnerDropdownMode.isPopupShowing());
}
@Test
@@ -450,38 +422,5 @@ public class SpinnerTest {
PollingCheck.waitFor(() -> mSpinnerDialogMode.isPopupShowing());
// And test that getPopupBackground returns null
assertNull(mSpinnerDialogMode.getPopupBackground());
-
- // Dismiss the popup with the emulated back key
- mInstrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_BACK);
- // Verify that we're not showing the popup
- PollingCheck.waitFor(() -> !mSpinnerDialogMode.isPopupShowing());
-
- // Set yellow background on the popup
- mActivityRule.runOnUiThread(() ->
- mSpinnerDialogMode.setPopupBackgroundDrawable(
- mActivity.getDrawable(R.drawable.yellow_fill)));
-
- // Use instrumentation to emulate a tap on the spinner to bring down its popup
- WidgetTestUtils.runOnMainAndDrawSync(mActivityRule, mSpinnerDialogMode, () -> {
- mSpinnerDialogMode.performClick();
- });
- // Verify that we're showing the popup
- PollingCheck.waitFor(() -> mSpinnerDialogMode.isPopupShowing());
- // And test that getPopupBackground returns null
- assertNull(mSpinnerDialogMode.getPopupBackground());
-
- // Use emulated escape key to close popup
- mInstrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_ESCAPE);
- // Verify that we're not showing the popup
- PollingCheck.waitFor(() -> !mSpinnerDropdownMode.isPopupShowing());
- }
-
- private void waitForHasFocusMS(int milliseconds) {
- try {
- Thread.sleep(milliseconds);
- } catch (InterruptedException e) {
- fail("unexpected InterruptedException : "+ e);
- }
-
}
}