Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit a42ddc1

Browse files
authored
Followup to #44982 (#45018)
One change was missing from #44982 when I applied auto submit.
1 parent a2adaa3 commit a42ddc1

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

shell/platform/android/test/io/flutter/embedding/android/FlutterFragmentTest.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff 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()

0 commit comments

Comments
 (0)