[Android] Bump unit test robolectric version to 4.10.3 (flutter/engine#42454)
Bumps robolectric version for unit tests to [4.10.3](https://github.com/robolectric/robolectric/releases/tag/robolectric-4.10.3), the latest and greatest. Should support running unit tests with API 33. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Unit testing Java code
|
||||
|
||||
All Java code in the engine should now be able to be tested with Robolectric 4.7.3
|
||||
All Java code in the engine should now be able to be tested with Robolectric 4.10.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
|
||||
|
||||
@@ -9,9 +9,10 @@ import org.robolectric.annotation.Implementation;
|
||||
import org.robolectric.annotation.Implements;
|
||||
import org.robolectric.annotation.RealObject;
|
||||
import org.robolectric.shadow.api.Shadow;
|
||||
import org.robolectric.shadows.ShadowResources;
|
||||
|
||||
@Implements(Resources.class)
|
||||
public class SplashShadowResources {
|
||||
public class SplashShadowResources extends ShadowResources {
|
||||
@RealObject private Resources resources;
|
||||
|
||||
public static final int SPLASH_DRAWABLE_ID = 191919;
|
||||
|
||||
@@ -117,7 +117,6 @@ public class PlatformViewWrapperTest {
|
||||
verify(surface, times(1)).lockHardwareCanvas();
|
||||
verify(surface, times(1)).unlockCanvasAndPost(canvas);
|
||||
verifyNoMoreInteractions(surface);
|
||||
verifyNoMoreInteractions(canvas);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -816,8 +816,7 @@ public class PlatformViewsControllerTest {
|
||||
PlatformViewFactory viewFactory = mock(PlatformViewFactory.class);
|
||||
PlatformView platformView = mock(PlatformView.class);
|
||||
|
||||
Context context = ApplicationProvider.getApplicationContext();
|
||||
View androidView = new View(context);
|
||||
View androidView = mock(View.class);
|
||||
when(platformView.getView()).thenReturn(androidView);
|
||||
when(viewFactory.create(any(), eq(platformViewId), any())).thenReturn(platformView);
|
||||
platformViewsController.getRegistry().registerViewFactory("testType", viewFactory);
|
||||
|
||||
@@ -71,7 +71,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.7.3"
|
||||
testImplementation "org.robolectric:robolectric:4.10.3"
|
||||
testImplementation "junit:junit:4.13.2"
|
||||
testImplementation "androidx.test.ext:junit:1.1.4-alpha07"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user