From c6b5f8b64df8cbbe64e255dd29162c328f4b11fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Muller?= Date: Wed, 27 Aug 2025 13:11:51 +0200 Subject: [PATCH] Remove explicit `@TextLayoutMode` and `@LooperMode` This commit removes explicit `@TextLayoutMode` and `@LooperMode` declarations, since they use the default value. --- ui/espresso/CustomMatcherSample/app/build.gradle | 1 - .../espresso/CustomMatcherSample/HintMatchersTest.java | 8 +------- ui/espresso/FragmentScenarioSample/app/build.gradle | 1 - .../espresso/fragmentscenario/SampleDialogFragmentTest.kt | 1 - .../espresso/fragmentscenario/SampleFragmentTest.kt | 1 - ui/espresso/IntentsBasicSample/app/build.gradle | 1 - .../espresso/IntentsBasicSample/DialerActivityTest.java | 2 -- 7 files changed, 1 insertion(+), 14 deletions(-) diff --git a/ui/espresso/CustomMatcherSample/app/build.gradle b/ui/espresso/CustomMatcherSample/app/build.gradle index 0774be6bf..8826e5163 100644 --- a/ui/espresso/CustomMatcherSample/app/build.gradle +++ b/ui/espresso/CustomMatcherSample/app/build.gradle @@ -62,7 +62,6 @@ dependencies { androidTestImplementation "androidx.test.ext:junit:" + rootProject.extJUnitVersion; androidTestImplementation "androidx.test:runner:" + rootProject.runnerVersion; androidTestImplementation "androidx.test.espresso:espresso-core:" + rootProject.espressoVersion; - androidTestImplementation "org.robolectric:annotations:" + rootProject.robolectricVersion; testImplementation "androidx.test:core:" + rootProject.coreVersion; testImplementation "androidx.test.ext:junit:" + rootProject.extJUnitVersion; diff --git a/ui/espresso/CustomMatcherSample/app/src/sharedTest/java/com/example/android/testing/espresso/CustomMatcherSample/HintMatchersTest.java b/ui/espresso/CustomMatcherSample/app/src/sharedTest/java/com/example/android/testing/espresso/CustomMatcherSample/HintMatchersTest.java index b9b597e32..547fdf8db 100644 --- a/ui/espresso/CustomMatcherSample/app/src/sharedTest/java/com/example/android/testing/espresso/CustomMatcherSample/HintMatchersTest.java +++ b/ui/espresso/CustomMatcherSample/app/src/sharedTest/java/com/example/android/testing/espresso/CustomMatcherSample/HintMatchersTest.java @@ -36,8 +36,6 @@ import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; -import org.robolectric.annotation.LooperMode; -import org.robolectric.annotation.TextLayoutMode; /** * Tests for {@link MainActivity} showcasing the use of custom matchers (see @@ -45,10 +43,6 @@ */ @RunWith(AndroidJUnit4.class) @LargeTest -// Configure Robolectric to use the more realistic text layout and threading model. -// These annotations can be removed once this is default behavior in Robolectric -@TextLayoutMode(TextLayoutMode.Mode.REALISTIC) -@LooperMode(LooperMode.Mode.PAUSED) public class HintMatchersTest { private static final String INVALID_STRING_TO_BE_TYPED = "Earl Grey"; @@ -142,4 +136,4 @@ public void validation_resultIsIncorrect() { onView(withId(R.id.inputValidationError)).check(matches(isDisplayed())); onView(withId(R.id.inputValidationSuccess)).check(matches(not(isDisplayed()))); } -} \ No newline at end of file +} diff --git a/ui/espresso/FragmentScenarioSample/app/build.gradle b/ui/espresso/FragmentScenarioSample/app/build.gradle index eac4095e4..f88f20e18 100644 --- a/ui/espresso/FragmentScenarioSample/app/build.gradle +++ b/ui/espresso/FragmentScenarioSample/app/build.gradle @@ -79,5 +79,4 @@ dependencies { androidTestImplementation "androidx.test.espresso:espresso-core:" + rootProject.espressoVersion androidTestImplementation "androidx.fragment:fragment-testing:" + rootProject.androidxFragmentVersion androidTestImplementation "com.google.truth:truth:" + rootProject.truthVersion - androidTestImplementation "org.robolectric:annotations:" + rootProject.robolectricVersion } diff --git a/ui/espresso/FragmentScenarioSample/app/src/sharedTest/java/com/example/android/testing/espresso/fragmentscenario/SampleDialogFragmentTest.kt b/ui/espresso/FragmentScenarioSample/app/src/sharedTest/java/com/example/android/testing/espresso/fragmentscenario/SampleDialogFragmentTest.kt index 8844e0f71..be96c11c3 100644 --- a/ui/espresso/FragmentScenarioSample/app/src/sharedTest/java/com/example/android/testing/espresso/fragmentscenario/SampleDialogFragmentTest.kt +++ b/ui/espresso/FragmentScenarioSample/app/src/sharedTest/java/com/example/android/testing/espresso/fragmentscenario/SampleDialogFragmentTest.kt @@ -10,7 +10,6 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import com.google.common.truth.Truth.assertThat import org.junit.Test import org.junit.runner.RunWith -import org.robolectric.annotation.LooperMode /** * A test using the androidx.test unified API, which can execute on an Android device or locally using Robolectric. diff --git a/ui/espresso/FragmentScenarioSample/app/src/sharedTest/java/com/example/android/testing/espresso/fragmentscenario/SampleFragmentTest.kt b/ui/espresso/FragmentScenarioSample/app/src/sharedTest/java/com/example/android/testing/espresso/fragmentscenario/SampleFragmentTest.kt index b35a058d0..8fa343458 100644 --- a/ui/espresso/FragmentScenarioSample/app/src/sharedTest/java/com/example/android/testing/espresso/fragmentscenario/SampleFragmentTest.kt +++ b/ui/espresso/FragmentScenarioSample/app/src/sharedTest/java/com/example/android/testing/espresso/fragmentscenario/SampleFragmentTest.kt @@ -9,7 +9,6 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import org.junit.Test import org.junit.runner.RunWith -import org.robolectric.annotation.LooperMode /** * A test using the androidx.test unified API, which can execute on an Android device or locally using Robolectric. diff --git a/ui/espresso/IntentsBasicSample/app/build.gradle b/ui/espresso/IntentsBasicSample/app/build.gradle index 08cca1c84..2ed9966df 100644 --- a/ui/espresso/IntentsBasicSample/app/build.gradle +++ b/ui/espresso/IntentsBasicSample/app/build.gradle @@ -61,7 +61,6 @@ dependencies { androidTestImplementation "androidx.test.espresso:espresso-intents:" + rootProject.espressoVersion; androidTestImplementation "androidx.test.ext:truth:" + rootProject.extTruthVersion; androidTestImplementation "androidx.test.ext:junit:" + rootProject.extJUnitVersion; - androidTestImplementation "org.robolectric:annotations:" + rootProject.robolectricVersion; testImplementation "androidx.test:core:" + rootProject.coreVersion; testImplementation "androidx.test.ext:junit:" + rootProject.extJUnitVersion; diff --git a/ui/espresso/IntentsBasicSample/app/src/sharedTest/java/com/example/android/testing/espresso/IntentsBasicSample/DialerActivityTest.java b/ui/espresso/IntentsBasicSample/app/src/sharedTest/java/com/example/android/testing/espresso/IntentsBasicSample/DialerActivityTest.java index 5e3e2bfe4..d642f6b3e 100644 --- a/ui/espresso/IntentsBasicSample/app/src/sharedTest/java/com/example/android/testing/espresso/IntentsBasicSample/DialerActivityTest.java +++ b/ui/espresso/IntentsBasicSample/app/src/sharedTest/java/com/example/android/testing/espresso/IntentsBasicSample/DialerActivityTest.java @@ -35,7 +35,6 @@ import static androidx.test.ext.truth.content.IntentSubject.assertThat; import static org.hamcrest.Matchers.not; import static org.hamcrest.core.AllOf.allOf; -import static org.robolectric.annotation.TextLayoutMode.Mode.REALISTIC; import android.app.Activity; import android.content.Intent; @@ -52,7 +51,6 @@ import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; -import org.robolectric.annotation.TextLayoutMode; @RunWith(AndroidJUnit4.class) @LargeTest