Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion shell/platform/android/test/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Unit testing Java code

All Java code in the engine should now be able to be tested with Robolectric 4.6.1
All Java code in the engine should now be able to be tested with Robolectric 4.7.3
and JUnit 4. The test suite has been added after the bulk of the Java code was
first written, so most of these classes do not have existing tests. Ideally code
after this point should be tested, either with unit tests here or with
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package io.flutter.plugin.platform;

import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1;
import static android.os.Build.VERSION_CODES.P;
import static android.os.Build.VERSION_CODES.R;
import static junit.framework.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
Expand All @@ -18,9 +21,10 @@

@Config(manifest = Config.NONE)
@RunWith(RobolectricTestRunner.class)
@TargetApi(28)
@TargetApi(P)
public class SingleViewPresentationTest {
@Test
@Config(minSdk = JELLY_BEAN_MR1, maxSdk = R)
public void returnsOuterContextInputMethodManager() {
// There's a bug in Android Q caused by the IMM being instanced per display.
// https://github.com/flutter/flutter/issues/38375. We need the context returned by
Expand Down Expand Up @@ -51,6 +55,7 @@ public void returnsOuterContextInputMethodManager() {
}

@Test
@Config(minSdk = JELLY_BEAN_MR1, maxSdk = R)
public void returnsOuterContextInputMethodManager_createDisplayContext() {
// The IMM should also persist across display contexts created from the base context.

Expand Down
2 changes: 1 addition & 1 deletion shell/platform/android/test_runner/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ android {
testImplementation "androidx.test:core:1.4.0"
testImplementation "com.google.android.play:core:1.8.0"
testImplementation "com.ibm.icu:icu4j:69.1"
testImplementation "org.robolectric:robolectric:4.6.1"
testImplementation "org.robolectric:robolectric:4.7.3"
testImplementation "junit:junit:4.13"

def mockitoVersion = "4.1.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sdk=30
sdk=31