Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clear InputMethodManager.sInstance for SDK > P
This fixes a minor case of test pollution when a test interacts with a TextView. InputMethodManager.sInstance still gets populated in SDK > P, and it may contain a reference to a ViewRootImpl (mCurRootView), which causes an Activity to leak across tests. PiperOrigin-RevId: 411153919
- Loading branch information
1 parent
bda68fd
commit f0d451b
Showing
3 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
integration_tests/androidx_test/src/main/AndroidManifest-NoTestPackageActivities.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
Manifest for ATSL integration tests | ||
--> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="org.robolectric.integration.axt"> | ||
<uses-sdk android:targetSdkVersion="28"/> | ||
|
||
<uses-permission android:name="android.permission.READ_CONTACTS"/> | ||
|
||
<application> | ||
<activity android:name="org.robolectric.integrationtests.axt.EspressoActivity" | ||
android:label="Activity Label" | ||
android:exported="true" /> | ||
<activity android:name="org.robolectric.integrationtests.axt.ActivityWithPlatformMenu" | ||
android:exported="true"> | ||
</activity> | ||
<activity android:name="org.robolectric.integrationtests.axt.ActivityWithAppCompatMenu" | ||
android:exported="true" | ||
android:theme="@style/Theme.AppCompat" /> | ||
<activity android:name="org.robolectric.integrationtests.axt.AppCompatActivityWithToolbarMenu" | ||
android:exported="true" | ||
android:theme="@style/Theme.AppCompat.NoActionBar" /> | ||
<activity android:name="org.robolectric.integrationtests.axt.ActivityWithSwitchCompat" | ||
android:exported="true" | ||
android:theme="@style/Theme.AppCompat" /> | ||
<activity android:name="org.robolectric.integrationtests.axt.StubBrowserActivity" | ||
android:exported="true"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.VIEW" /> | ||
<category android:name="android.intent.category.DEFAULT" /> | ||
<category android:name="android.intent.category.BROWSABLE" /> | ||
<data android:scheme="http" /> | ||
<data android:scheme="https" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
</manifest> |
18 changes: 18 additions & 0 deletions
18
integration_tests/androidx_test/src/test/AndroidManifest-NoTestPackageActivities.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="org.robolectric.integrationtests.axt"> | ||
|
||
<uses-sdk | ||
android:minSdkVersion="14" | ||
android:targetSdkVersion="27"/> | ||
|
||
<application> | ||
<activity android:name=".EspressoActivity" android:exported="true"/> | ||
</application> | ||
|
||
<instrumentation | ||
android:name="androidx.test.runner.AndroidJUnitRunner" | ||
android:targetPackage="org.robolectric.integration.axt"/> | ||
|
||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters