This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
shell/platform/android/test/io/flutter/embedding/android Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -284,8 +284,11 @@ public void itReturnsExclusiveAppComponent() {
284284 }
285285
286286 @ SuppressWarnings ("deprecation" )
287- // Robolectric.setupActivity
288- // TODO(reidbaker): https://github.com/flutter/flutter/issues/133151
287+ private FragmentActivity getMockFragmentActivity () {
288+ // TODO(reidbaker): https://github.com/flutter/flutter/issues/133151
289+ return Robolectric .setupActivity (FragmentActivity .class );
290+ }
291+
289292 @ Test
290293 public void itDelegatesOnBackPressedAutomaticallyWhenEnabled () {
291294 // We need to mock FlutterJNI to avoid triggering native code.
@@ -300,7 +303,7 @@ public void itDelegatesOnBackPressedAutomaticallyWhenEnabled() {
300303 FlutterFragment .withCachedEngine ("my_cached_engine" )
301304 .shouldAutomaticallyHandleOnBackPressed (true )
302305 .build ();
303- FragmentActivity activity = Robolectric . setupActivity ( FragmentActivity . class );
306+ FragmentActivity activity = getMockFragmentActivity ( );
304307 activity
305308 .getSupportFragmentManager ()
306309 .beginTransaction ()
@@ -337,7 +340,7 @@ public void itHandlesPopSystemNavigationAutomaticallyWhenEnabled() {
337340 FlutterFragment .withCachedEngine ("my_cached_engine" )
338341 .shouldAutomaticallyHandleOnBackPressed (true )
339342 .build ();
340- FragmentActivity activity = Robolectric . setupActivity ( FragmentActivity . class );
343+ FragmentActivity activity = getMockFragmentActivity ( );
341344 activity
342345 .getSupportFragmentManager ()
343346 .beginTransaction ()
You can’t perform that action at this time.
0 commit comments