Add test case for AndroidView clipBehavior#67913
Add test case for AndroidView clipBehavior#67913fluttergithubbot merged 3 commits intoflutter:masterfrom
Conversation
liyuqian
left a comment
There was a problem hiding this comment.
Thanks for writing this test! Here are a few minor comments.
| } | ||
| }); | ||
|
|
||
| testWidgets('clipBehavior test', (WidgetTester tester) async { |
There was a problem hiding this comment.
nit: make the test name more descriptive such as 'clip is handled correctly during resizing'
| ); | ||
| } | ||
|
|
||
| await tester.pumpWidget(buildView(200.0, 200.0, Clip.none)); |
There was a problem hiding this comment.
This test seems to rely on RenderAndroidView to be retained in its last size while the parent widget resizes. I can't find any description about this behavior in https://master-api.flutter.dev/flutter/widgets/AndroidView-class.html. CC @cyanglaz @amirh to double check if this is expected and whether we can rely on this.
There was a problem hiding this comment.
There is an existing test case to test this behavior:
flutter/packages/flutter/test/widgets/platform_view_test.dart
Lines 106 to 154 in 4cfd7d3
| // No clip happen when the clip behavior is `Clip.none` . | ||
| expect(tester.layers.whereType<ClipRectLayer>(), hasLength(0)); | ||
|
|
||
| // No clip happen when the clip behavior only change. |
There was a problem hiding this comment.
// No clip happen when the clip behavior only change. -> // No clip when only the clip behavior changes while the size remains the same.
Description
@liyuqian
Add a test case for AndroidView clipBehavior
Related Issues
Fixes #67455
#67343
Tests
See files.