Skip to content

Commit 3143e7c

Browse files
Drop support for 21/22 Lollipop (#170748)
Update Robolectric tests to run on minSdk 23. Some of the code are modified/removed to support the same. <!-- Thanks for filing a pull request! Reviewers are typically assigned within a week of filing a request. To learn more about code review, see our documentation on Tree Hygiene: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md --> *Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.* *List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.* *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
1 parent 2d383ad commit 3143e7c

File tree

1 file changed

+0
-46
lines changed

1 file changed

+0
-46
lines changed

engine/src/flutter/shell/platform/android/test/io/flutter/embedding/android/FlutterViewTest.java

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -494,44 +494,6 @@ public void systemInsetHandlesFullscreenNavbarRight() {
494494
validateViewportMetricPadding(viewportMetricsCaptor, 100, 0, 0, 0);
495495
}
496496

497-
@SuppressWarnings("deprecation")
498-
// getSystemUiVisibility, getWindowSystemUiVisibility required to test pre api 30 behavior.
499-
@Test
500-
@Config(minSdk = 20, maxSdk = 22, qualifiers = "land")
501-
public void systemInsetHandlesFullscreenNavbarRightBelowSDK23() {
502-
FlutterView flutterView = spy(new FlutterView(ctx));
503-
setExpectedDisplayRotation(Surface.ROTATION_270);
504-
assertEquals(0, flutterView.getSystemUiVisibility());
505-
when(flutterView.getWindowSystemUiVisibility())
506-
.thenReturn(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
507-
when(flutterView.getContext()).thenReturn(ctx);
508-
509-
FlutterEngine flutterEngine = spy(new FlutterEngine(ctx, mockFlutterLoader, mockFlutterJni));
510-
FlutterRenderer flutterRenderer = spy(new FlutterRenderer(mockFlutterJni));
511-
when(flutterEngine.getRenderer()).thenReturn(flutterRenderer);
512-
513-
// When we attach a new FlutterView to the engine without any system insets,
514-
// the viewport metrics default to 0.
515-
flutterView.attachToFlutterEngine(flutterEngine);
516-
ArgumentCaptor<FlutterRenderer.ViewportMetrics> viewportMetricsCaptor =
517-
ArgumentCaptor.forClass(FlutterRenderer.ViewportMetrics.class);
518-
verify(flutterRenderer).setViewportMetrics(viewportMetricsCaptor.capture());
519-
assertEquals(0, viewportMetricsCaptor.getValue().viewPaddingTop);
520-
521-
// Then we simulate the system applying a window inset.
522-
WindowInsets windowInsets = mock(WindowInsets.class);
523-
mockSystemWindowInsets(windowInsets, 100, 100, 100, 100);
524-
mockSystemGestureInsetsIfNeed(windowInsets);
525-
526-
flutterView.onApplyWindowInsets(windowInsets);
527-
528-
verify(flutterRenderer, times(2)).setViewportMetrics(viewportMetricsCaptor.capture());
529-
// Top padding is removed due to full screen.
530-
// Right padding is zero because the rotation is 270deg under SDK 23
531-
// Bottom padding is removed due to hide navigation.
532-
validateViewportMetricPadding(viewportMetricsCaptor, 100, 0, 0, 0);
533-
}
534-
535497
@Test
536498
@Config(minSdk = API_LEVELS.FLUTTER_MIN, maxSdk = API_LEVELS.API_29, qualifiers = "port")
537499
public void calculateShouldZeroSidesInPortrait() {
@@ -558,14 +520,6 @@ public void calculateShouldZeroSidesInLandscapeRotation90() {
558520
assertEquals(FlutterView.ZeroSides.RIGHT, flutterView.calculateShouldZeroSides());
559521
}
560522

561-
@Test
562-
@Config(minSdk = API_LEVELS.API_21, maxSdk = API_LEVELS.API_22, qualifiers = "land")
563-
public void calculateShouldZeroSidesInLandscapeRotation270API22() {
564-
FlutterView flutterView = spy(new FlutterView(ctx));
565-
setExpectedDisplayRotation(Surface.ROTATION_270);
566-
assertEquals(FlutterView.ZeroSides.RIGHT, flutterView.calculateShouldZeroSides());
567-
}
568-
569523
@Test
570524
@Config(minSdk = API_LEVELS.API_23, maxSdk = API_LEVELS.API_29, qualifiers = "land")
571525
public void calculateShouldZeroSidesInLandscapeRotation270API23Plus() {

0 commit comments

Comments
 (0)