Skip to content

Commit

Permalink
Followup to #44982 (#45018)
Browse files Browse the repository at this point in the history
One change was missing from #44982 when I applied auto submit.
  • Loading branch information
reidbaker authored Aug 23, 2023
1 parent a2adaa3 commit a42ddc1
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,11 @@ public void itReturnsExclusiveAppComponent() {
}

@SuppressWarnings("deprecation")
// Robolectric.setupActivity
// TODO(reidbaker): https://github.com/flutter/flutter/issues/133151
private FragmentActivity getMockFragmentActivity() {
// TODO(reidbaker): https://github.com/flutter/flutter/issues/133151
return Robolectric.setupActivity(FragmentActivity.class);
}

@Test
public void itDelegatesOnBackPressedAutomaticallyWhenEnabled() {
// We need to mock FlutterJNI to avoid triggering native code.
Expand All @@ -300,7 +303,7 @@ public void itDelegatesOnBackPressedAutomaticallyWhenEnabled() {
FlutterFragment.withCachedEngine("my_cached_engine")
.shouldAutomaticallyHandleOnBackPressed(true)
.build();
FragmentActivity activity = Robolectric.setupActivity(FragmentActivity.class);
FragmentActivity activity = getMockFragmentActivity();
activity
.getSupportFragmentManager()
.beginTransaction()
Expand Down Expand Up @@ -337,7 +340,7 @@ public void itHandlesPopSystemNavigationAutomaticallyWhenEnabled() {
FlutterFragment.withCachedEngine("my_cached_engine")
.shouldAutomaticallyHandleOnBackPressed(true)
.build();
FragmentActivity activity = Robolectric.setupActivity(FragmentActivity.class);
FragmentActivity activity = getMockFragmentActivity();
activity
.getSupportFragmentManager()
.beginTransaction()
Expand Down

0 comments on commit a42ddc1

Please sign in to comment.