Skip to content

Handle#6537 third grouped tests#183059

Merged
auto-submit[bot] merged 15 commits into
flutter:masterfrom
ahmedsameha1:handle#6537-third-grouped-tests
Apr 1, 2026
Merged

Handle#6537 third grouped tests#183059
auto-submit[bot] merged 15 commits into
flutter:masterfrom
ahmedsameha1:handle#6537-third-grouped-tests

Conversation

@ahmedsameha1

Copy link
Copy Markdown
Contributor

This is my attempt to handle #6537 for the following widgets:
Placeholder
RadioGroup
RawMenuAnchor
RawMenuAnchorGroup
RawRadio
RawTooltip
ReorderableList
ReorderableDragStartListener
ReorderableDelayedDragStartListener
RepeatingAnimationBuilder

@github-actions github-actions Bot added framework flutter/packages/flutter repository. See also f: labels. a: animation Animation APIs labels Feb 28, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a series of widget tests to ensure that various widgets do not crash when rendered in a zero-sized area, addressing issue #6537. The new tests cover widgets like Placeholder, RadioGroup, RawMenuAnchor, RawTooltip, and ReorderableList, among others. My review includes a correction for a typo in a test name and a fix for a resource leak where a FocusNode was not being disposed of properly in one of the new tests.

Comment thread packages/flutter/test/widgets/raw_radio_test.dart Outdated
Comment thread packages/flutter/test/widgets/radio_group_test.dart Outdated
@ahmedsameha1 ahmedsameha1 force-pushed the handle#6537-third-grouped-tests branch from 1d4e0da to 6f74440 Compare February 28, 2026 10:01

import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't import material/ in the widgets library.

tester.view.physicalSize = Size.zero;
addTearDown(tester.view.reset);
await tester.pumpWidget(
MaterialApp(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be done without MaterialApp, see TestWidgetsApp etc.


testWidgets('RadioGroup does not crash at zero area', (WidgetTester tester) async {
await tester.pumpWidget(
MaterialApp(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does TestWidgetsApp work here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I see, this commit did not import any files.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to import material/ in widgets/ tests, see #177415 for more information.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I followed #180456, I got:
The following assertion was thrown building Radio<int>(dirty, state: _RadioState<int>#c9c88): No Material widget found.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Radio is a Material library widget, I think you can test RadioGroup without using Radio. See RawRadio for instance.


testWidgets('ReorderableList does not crash at zero area', (WidgetTester tester) async {
await tester.pumpWidget(
MaterialApp(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestWidgetsApp?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I see, this commit did not import any files.

WidgetTester tester,
) async {
await tester.pumpWidget(
const MaterialApp(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I see, this commit did not import any files.

WidgetTester tester,
) async {
await tester.pumpWidget(
const MaterialApp(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I see, this commit did not import any files.

@ahmedsameha1 ahmedsameha1 force-pushed the handle#6537-third-grouped-tests branch from 6f74440 to 065020b Compare March 4, 2026 05:31

@dkwingsmt dkwingsmt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM except for TestWidgetsApp that @\victorsanni has pointed out.

@ahmedsameha1 ahmedsameha1 force-pushed the handle#6537-third-grouped-tests branch from 065020b to 02b1cfa Compare March 5, 2026 05:25
dkwingsmt
dkwingsmt previously approved these changes Mar 13, 2026

@dkwingsmt dkwingsmt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

addTearDown(focusNode2.dispose);
await tester.pumpWidget(
TestWidgetsApp(
home: Scaffold(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scaffold is a Material widget.

import 'package:flutter_test/flutter_test.dart';

import 'editable_text_tester.dart';
import 'raw_radio_test.dart';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we importing a test? This is causing the linux analyze failures.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestRegistry is from 'raw_radio_test.dart', final RadioGroupRegistry<T>? groupRegistry is required for RawRadio.

@dkwingsmt dkwingsmt Mar 16, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend copying the TestRegistry class to this file. It's ok since it's a small class.

If in the future there are larger code snippets to be shared between files, they should be placed in dedicated util files such as widgets_app_tester.dart. Test files should never be imported to another.

@ahmedsameha1 ahmedsameha1 force-pushed the handle#6537-third-grouped-tests branch from 3e0b84f to 12b36b8 Compare March 14, 2026 05:20
@dkwingsmt dkwingsmt added CICD Run CI/CD and removed CICD Run CI/CD labels Mar 14, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Mar 17, 2026
@dkwingsmt dkwingsmt requested a review from victorsanni March 17, 2026 22:45
@dkwingsmt dkwingsmt added the CICD Run CI/CD label Mar 17, 2026
@victorsanni victorsanni added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 24, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Mar 24, 2026
@auto-submit

auto-submit Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/183059, because The base commit of the PR is older than 7 days and can not be merged. Please merge the latest changes from the main into this branch and resubmit the PR.

@github-actions github-actions Bot removed the CICD Run CI/CD label Mar 31, 2026
@justinmc justinmc requested a review from Piinks March 31, 2026 22:09

@justinmc justinmc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re LGTM now that they've expired 👍

@Piinks Piinks added autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD labels Mar 31, 2026
@Piinks

Piinks commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

This might get bumped out of autosubmit again, I can't tell if this was a merge or a rebase to update. If it kicks it back out, it should be rebased to update the base commit.

@auto-submit auto-submit Bot added this pull request to the merge queue Apr 1, 2026
Merged via the queue into flutter:master with commit 292cea7 Apr 1, 2026
79 of 80 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Apr 1, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 1, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 1, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 1, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 1, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Apr 2, 2026
Roll Flutter from fb03253e32ce to 3d69471c0bf9 (69 revisions)

flutter/flutter@fb03253...3d69471

2026-04-01 [email protected] Roll Dart SDK from 1308a3076402 to 043a2bfd56ff (1 revision) (flutter/flutter#184453)
2026-04-01 [email protected] Roll Skia from a657b5446209 to c2363c39c283 (2 revisions) (flutter/flutter#184448)
2026-04-01 [email protected] Fix layout overflowed in small screen in SensitiveContent's example (flutter/flutter#184179)
2026-04-01 [email protected] Roll Skia from e0b25041a5d5 to a657b5446209 (1 revision) (flutter/flutter#184445)
2026-04-01 [email protected] Roll Dart SDK from 75a089eb6bf9 to 1308a3076402 (3 revisions) (flutter/flutter#184444)
2026-04-01 [email protected] [AGP 9] Bumping KGP error minimum to 2.0.0 (flutter/flutter#184385)
2026-04-01 [email protected] [ Tool ] Migrate `flutter analyze` to use LSP (flutter/flutter#183785)
2026-04-01 [email protected] Adds uber sdf shader gradients with blend (flutter/flutter#184090)
2026-04-01 [email protected] Add bottom safe area padding to licenses package license page (flutter/flutter#182425)
2026-04-01 [email protected] Handle#6537 third grouped tests (flutter/flutter#183059)
2026-04-01 [email protected] Roll Skia from f37239a7a689 to e0b25041a5d5 (9 revisions) (flutter/flutter#184436)
2026-03-31 [email protected] [Impeller] Do not log an error when wrapping an empty texture as a TextureGLES (flutter/flutter#184377)
2026-03-31 [email protected] Remove the default_git_folder GN argument (flutter/flutter#184152)
2026-03-31 [email protected] Remove the cupertino_icons dependency from the spell_check integration test (flutter/flutter#184398)
2026-03-31 [email protected] Roll Fuchsia Linux SDK from pM94cWC9cSgao0CG0... to fV-JIWUt4FQGeDtEe... (flutter/flutter#184383)
2026-03-31 [email protected] Roll Dart SDK from eaeccf98848d to 75a089eb6bf9 (1 revision) (flutter/flutter#184379)
2026-03-31 [email protected] [web] Fix autofill in iOS 26 Safari (flutter/flutter#182024)
2026-03-31 [email protected] Roll Fuchsia GN SDK from SEfYx3xgueX3aFAY3... to JLBh4Z9PKsjIJcqDU... (flutter/flutter#184368)
2026-03-31 [email protected] [Windows] Restore and enable IAccessibleEx implementation (flutter/flutter#175406)
2026-03-31 [email protected] Revert "Even more awaits (#184042)" (flutter/flutter#184429)
2026-03-31 [email protected] Roll Skia from dfd8f8002800 to f37239a7a689 (2 revisions) (flutter/flutter#184374)
2026-03-31 [email protected] Remove workaround for fake impeller images in iOS simulator. (flutter/flutter#184264)
2026-03-31 [email protected] Even more awaits (flutter/flutter#184042)
2026-03-31 [email protected] Roll Packages from 582f0e7 to b04f3e5 (6 revisions) (flutter/flutter#184393)
2026-03-30 [email protected] Fixes a flake in reload shaders tests (flutter/flutter#184268)
2026-03-30 [email protected] Remove an obsolete script for setting up remote GDB sessions on Android devices (flutter/flutter#184357)
2026-03-30 [email protected] Roll Skia from 8dcde79fef2a to dfd8f8002800 (10 revisions) (flutter/flutter#184363)
2026-03-30 [email protected] Roll Dart SDK from 0aaccc3c8004 to eaeccf98848d (2 revisions) (flutter/flutter#184362)
2026-03-30 [email protected] [ Tool ] Remove `flutter running-apps` command (flutter/flutter#183742)
2026-03-30 [email protected] Roll pub packages (flutter/flutter#184045)
2026-03-30 [email protected] Rick roll triagers on/near April 1st (flutter/flutter#184355)
2026-03-30 49699333+dependabot[bot]@users.noreply.github.com Bump codecov/codecov-action from 5.5.0 to 6.0.0 in the all-github-actions group (flutter/flutter#184364)
2026-03-30 [email protected] fix(web): call ui.Picture.onDispose for the original picture only (flutter/flutter#184348)
2026-03-30 [email protected] Roll Skia from e001e6901e3b to 8dcde79fef2a (7 revisions) (flutter/flutter#184356)
2026-03-30 [email protected] [web] Make it safe to call dispose multiple times on a CkSurface (flutter/flutter#184270)
2026-03-30 [email protected] Roll HarfBuzz to 13.2.1 (flutter/flutter#184210)
2026-03-30 [email protected] web_ui: Remove unused parameters in a few places (flutter/flutter#183156)
2026-03-30 [email protected] Update TabBar documentation to clarify indicatorWeight behavior (flutter/flutter#184104)
2026-03-30 [email protected] Add title evaluation (flutter/flutter#184084)
2026-03-30 [email protected] fixes crash when invisible semantics nodes dropped from semantics tree (flutter/flutter#184226)
2026-03-30 [email protected] Roll Skia from cdaae3e3fdef to e001e6901e3b (4 revisions) (flutter/flutter#184345)
2026-03-30 [email protected] Roll Packages from 7ae082a to 582f0e7 (8 revisions) (flutter/flutter#184341)
2026-03-30 [email protected] Add alwaysSizeToContent argument to Overlay. (flutter/flutter#182009)
2026-03-30 [email protected] Roll Dart SDK from 598088a8a67f to 0aaccc3c8004 (1 revision) (flutter/flutter#184331)
2026-03-30 [email protected] Roll Skia from 6d7ade938643 to cdaae3e3fdef (2 revisions) (flutter/flutter#184329)
2026-03-30 [email protected] Roll Fuchsia Linux SDK from EnoD6zNQebz4EYuLk... to pM94cWC9cSgao0CG0... (flutter/flutter#184323)
...
ahmedsameha1 added a commit to ahmedsameha1/flutter that referenced this pull request Apr 14, 2026
This is my attempt to handle
flutter#6537 for the following
widgets:
Placeholder
RadioGroup
RawMenuAnchor
RawMenuAnchorGroup
RawRadio
RawTooltip
ReorderableList
ReorderableDragStartListener
ReorderableDelayedDragStartListener
RepeatingAnimationBuilder

---------

Co-authored-by: Tong Mu <[email protected]>
Co-authored-by: Justin McCandless <[email protected]>
mbcorona pushed a commit to mbcorona/flutter that referenced this pull request Apr 15, 2026
This is my attempt to handle
flutter#6537 for the following
widgets:
Placeholder
RadioGroup
RawMenuAnchor
RawMenuAnchorGroup
RawRadio
RawTooltip
ReorderableList
ReorderableDragStartListener
ReorderableDelayedDragStartListener
RepeatingAnimationBuilder

---------

Co-authored-by: Tong Mu <[email protected]>
Co-authored-by: Justin McCandless <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: animation Animation APIs CICD Run CI/CD framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants