diff options
3 files changed, 13 insertions, 31 deletions
diff --git a/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/AutoShowTest.java b/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/AutoShowTest.java index 3d257b29287f..807f0c63668c 100644 --- a/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/AutoShowTest.java +++ b/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/AutoShowTest.java @@ -199,8 +199,7 @@ public final class AutoShowTest { Collections.singletonList(REQUEST_FOCUS_ON_CREATE)); TestActivity firstActivity = TestActivity.start(intent1); // Show Ime with InputMethodManager to ensure the keyboard is on. - boolean succ = callOnMainSync(firstActivity::showImeWithInputMethodManager); - assertThat(succ).isTrue(); + callOnMainSync(firstActivity::showImeWithInputMethodManager); SystemClock.sleep(1000); mInstrumentation.waitForIdleSync(); @@ -264,8 +263,7 @@ public final class AutoShowTest { Collections.singletonList(REQUEST_FOCUS_ON_CREATE)); ImeStressTestUtil.TestActivity secondActivity = activity.startSecondTestActivity(intent2); // Show Ime with InputMethodManager to ensure the keyboard is shown on the second activity - boolean succ = callOnMainSync(secondActivity::showImeWithInputMethodManager); - assertThat(succ).isTrue(); + callOnMainSync(secondActivity::showImeWithInputMethodManager); SystemClock.sleep(1000); mInstrumentation.waitForIdleSync(); // Close the second activity diff --git a/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/DefaultImeVisibilityTest.java b/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/DefaultImeVisibilityTest.java index 299cbf1a84c7..0c267b27490b 100644 --- a/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/DefaultImeVisibilityTest.java +++ b/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/DefaultImeVisibilityTest.java @@ -26,8 +26,6 @@ import static com.android.inputmethod.stresstest.ImeStressTestUtil.verifyWindowA import static com.android.inputmethod.stresstest.ImeStressTestUtil.waitOnMainUntilImeIsHidden; import static com.android.inputmethod.stresstest.ImeStressTestUtil.waitOnMainUntilImeIsShown; -import static com.google.common.truth.Truth.assertThat; - import android.content.Intent; import android.platform.test.annotations.RootPermissionTest; import android.platform.test.rule.UnlockScreenRule; @@ -83,14 +81,11 @@ public final class DefaultImeVisibilityTest { ImeStressTestUtil.TestActivity activity = ImeStressTestUtil.TestActivity.start(intent); EditText editText = activity.getEditText(); for (int i = 0; i < NUM_TEST_ITERATIONS; i++) { - - boolean showResult = callOnMainSync(activity::showImeWithInputMethodManager); - assertThat(showResult).isTrue(); + callOnMainSync(activity::showImeWithInputMethodManager); verifyWindowAndViewFocus(editText, true, true); waitOnMainUntilImeIsShown(editText); - boolean hideResult = callOnMainSync(activity::hideImeWithInputMethodManager); - assertThat(hideResult).isTrue(); + callOnMainSync(activity::hideImeWithInputMethodManager); waitOnMainUntilImeIsHidden(editText); } } diff --git a/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/ImeOpenCloseStressTest.java b/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/ImeOpenCloseStressTest.java index b76a4eb8c0e6..5c0212400ff1 100644 --- a/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/ImeOpenCloseStressTest.java +++ b/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/ImeOpenCloseStressTest.java @@ -102,12 +102,10 @@ public final class ImeOpenCloseStressTest { for (int i = 0; i < iterNum; i++) { String msgPrefix = "Iteration #" + i + " "; Log.i(TAG, msgPrefix + "start"); - boolean showResult = callOnMainSync(activity::showImeWithInputMethodManager); - assertThat(showResult).isEqualTo(!(hasUnfocusableWindowFlags(activity))); + callOnMainSync(activity::showImeWithInputMethodManager); verifyShowBehavior(activity); - boolean hideResult = callOnMainSync(activity::hideImeWithInputMethodManager); - assertThat(hideResult).isEqualTo(!(hasUnfocusableWindowFlags(activity))); + callOnMainSync(activity::hideImeWithInputMethodManager); verifyHideBehavior(activity); } @@ -128,14 +126,12 @@ public final class ImeOpenCloseStressTest { for (int i = 0; i < NUM_TEST_ITERATIONS; i++) { String msgPrefix = "Iteration #" + i + " "; Log.i(TAG, msgPrefix + "start"); - boolean showResult = callOnMainSync(activity::showImeWithInputMethodManager); - assertThat(showResult).isTrue(); + callOnMainSync(activity::showImeWithInputMethodManager); waitOnMainUntil( msgPrefix + "IME should be visible", () -> !activity.isAnimating() && isImeShown(editText)); - boolean hideResult = callOnMainSync(activity::hideImeWithInputMethodManager); - assertThat(hideResult).isTrue(); + callOnMainSync(activity::hideImeWithInputMethodManager); waitOnMainUntil( msgPrefix + "IME should be hidden", () -> !activity.isAnimating() && !isImeShown(editText)); @@ -156,17 +152,13 @@ public final class ImeOpenCloseStressTest { List<Integer> intervals = new ArrayList<>(); for (int i = 10; i < 100; i += 10) intervals.add(i); for (int i = 100; i < 1000; i += 50) intervals.add(i); - boolean firstHide = false; for (int intervalMillis : intervals) { String msgPrefix = "Interval = " + intervalMillis + " "; Log.i(TAG, msgPrefix + " start"); - boolean hideResult = callOnMainSync(activity::hideImeWithInputMethodManager); - assertThat(hideResult).isEqualTo(firstHide); - firstHide = true; + callOnMainSync(activity::hideImeWithInputMethodManager); SystemClock.sleep(intervalMillis); - boolean showResult = callOnMainSync(activity::showImeWithInputMethodManager); - assertThat(showResult).isTrue(); + callOnMainSync(activity::showImeWithInputMethodManager); verifyShowBehavior(activity); } } @@ -247,8 +239,7 @@ public final class ImeOpenCloseStressTest { TestActivity activity = TestActivity.start(intent); // Show InputMethodManager without requesting focus - boolean showResult = callOnMainSync(activity::showImeWithInputMethodManager); - assertThat(showResult).isFalse(); + callOnMainSync(activity::showImeWithInputMethodManager); int windowFlags = activity.getWindow().getAttributes().flags; EditText editText = activity.getEditText(); @@ -474,8 +465,7 @@ public final class ImeOpenCloseStressTest { Collections.singletonList(REQUEST_FOCUS_ON_CREATE)); TestActivity activity = TestActivity.start(intent1); // Show Ime with InputMethodManager to ensure the keyboard is shown on the second activity - boolean showResult = callOnMainSync(activity::showImeWithInputMethodManager); - assertThat(showResult).isEqualTo(!(hasUnfocusableWindowFlags(activity))); + callOnMainSync(activity::showImeWithInputMethodManager); Thread.sleep(1000); verifyShowBehavior(activity); @@ -503,8 +493,7 @@ public final class ImeOpenCloseStressTest { Collections.singletonList(REQUEST_FOCUS_ON_CREATE)); TestActivity activity = TestActivity.start(intent); // Show Ime with InputMethodManager to ensure the keyboard is shown on the second activity - boolean showResult = callOnMainSync(activity::showImeWithInputMethodManager); - assertThat(showResult).isEqualTo(!(hasUnfocusableWindowFlags(activity))); + callOnMainSync(activity::showImeWithInputMethodManager); Thread.sleep(2000); verifyShowBehavior(activity); |