Skip to content

Conversation

@mattkae
Copy link
Contributor

@mattkae mattkae commented Dec 2, 2025

What's new?

This pull request makes it so that multi window applications can be tested via testWidgets. This PR implements the following:

  • A _TestWindowingOwner that is used by the TestWidgetsFlutterBinding
  • A _TestRegularWindowController implementation
  • A _TestDialogWindowController implementation
  • A _TestFlutterView and _TestDisplay for use by the controllers
  • Proper isActivated status across controllers
  • Proper minimization, maximization, and fullscreen status
  • Proper sizing (based on constraints)
  • Using the new testing abilities in the multiple windows example app

I have purposefully not implemented tooltip windows yet, as they are still awaiting an implementation in Win32 to be useful.

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

@github-actions github-actions bot added a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. d: examples Sample code and demos labels Dec 2, 2025
@mattkae mattkae marked this pull request as ready for review December 2, 2025 21:54
@mattkae mattkae requested a review from loic-sharma December 4, 2025 15:36
Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

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

LGTM 👍 . Thanks for circling back to this. It looks very straightforward for people to write tests for a multiwindow app just like they would for a regular Flutter app.

Just to check, what would it look like if I wanted to write a test that finds something only inside of any DialogWindow? What about only inside of some specific window? Maybe we should include tests like that at some point, but maybe not in this PR.

Comment on lines +9 to +10
// ignore: avoid_relative_lib_imports
import '../lib/main.dart' as multiple_windows;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be imported via package:multiple_windows? Like:

import 'package:hello_world/main.dart' as hello_world;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The analyzer disliked this, but let me try again!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  error • Target of URI doesn't exist: 'package:multiple_windows/main.dart' • examples/multiple_windows/test/multiple_windows_test.dart:9:8 • uri_does_not_exist

@mattkae
Copy link
Contributor Author

mattkae commented Dec 5, 2025

Just to check, what would it look like if I wanted to write a test that finds something only inside of any DialogWindow? What about only inside of some specific window? Maybe we should include tests like that at some point, but maybe not in this PR.

That's a good question! You can probably use the finder to grab different views and windows, but I haven't yet explored this much. We can try writing tests like this is in another PR and see what happens

@mattkae mattkae added this pull request to the merge queue Dec 8, 2025
Merged via the queue into flutter:master with commit 4000ce2 Dec 8, 2025
68 checks passed
@mattkae mattkae deleted the feature/test_windowing_owner branch December 8, 2025 14:50
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 8, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Dec 8, 2025
Roll Flutter from 5b8720312a94 to b2de367c41e0 (38 revisions)

flutter/flutter@5b87203...b2de367

2025-12-08 [email protected] Roll Packages from b17d3ff to 33a9a81 (3 revisions) (flutter/flutter#179579)
2025-12-08 [email protected] Roll Fuchsia Linux SDK from XCoAHsnYnKrvuWU2o... to _pSztGZvEA3-Ry-GW... (flutter/flutter#179575)
2025-12-08 [email protected] Implementation of `TestWindowingOwner` for testing multi-window (flutter/flutter#179355)
2025-12-08 [email protected] Roll Dart SDK from 11efe37089a7 to 75899721aa42 (2 revisions) (flutter/flutter#179573)
2025-12-08 [email protected] Roll Skia from 0c016e4aefd5 to b1936c760645 (8 revisions) (flutter/flutter#179568)
2025-12-08 [email protected] Roll Skia from 3c5f9e0c9269 to 0c016e4aefd5 (1 revision) (flutter/flutter#179565)
2025-12-08 [email protected] Roll Dart SDK from 1a6c6f6398af to 11efe37089a7 (1 revision) (flutter/flutter#179564)
2025-12-07 [email protected] Roll Skia from 4830855b6f84 to 3c5f9e0c9269 (1 revision) (flutter/flutter#179561)
2025-12-07 [email protected] Roll Skia from d5a6b6af6d12 to 4830855b6f84 (1 revision) (flutter/flutter#179557)
2025-12-07 [email protected] Roll Fuchsia Linux SDK from KilaJW3p3J_0yUDtV... to XCoAHsnYnKrvuWU2o... (flutter/flutter#179551)
2025-12-06 [email protected] Roll Skia from 33b32cecb287 to d5a6b6af6d12 (1 revision) (flutter/flutter#179540)
2025-12-06 [email protected] Roll Dart SDK from ea201dd2ef12 to 1a6c6f6398af (1 revision) (flutter/flutter#179539)
2025-12-06 [email protected] Roll Dart SDK from d1d30ee8d5a0 to ea201dd2ef12 (1 revision) (flutter/flutter#179537)
2025-12-06 [email protected] Roll Dart SDK from 30c906aa00f2 to d1d30ee8d5a0 (1 revision) (flutter/flutter#179534)
2025-12-06 [email protected] Roll Skia from dccd48c6c6ab to 33b32cecb287 (2 revisions) (flutter/flutter#179531)
2025-12-06 [email protected] Roll Fuchsia Linux SDK from vDeTl_KBeLJY8nCAx... to KilaJW3p3J_0yUDtV... (flutter/flutter#179530)
2025-12-06 [email protected] Roll Dart SDK from f3690c23d422 to 30c906aa00f2 (2 revisions) (flutter/flutter#179529)
2025-12-06 [email protected] Roll Skia from e19670f70406 to dccd48c6c6ab (6 revisions) (flutter/flutter#179524)
2025-12-05 [email protected] Make sure that a CupertinoFormRow doesn't crash in 0x0 environment (flutter/flutter#178979)
2025-12-05 [email protected] Make sure that a CupertinoContextMenuAction doesn't crash in 0x0 envi… (flutter/flutter#178721)
2025-12-05 [email protected] Make sure that a CupertinoRadio doesn't crash in 0x0 environment (flutter/flutter#179378)
2025-12-05 [email protected] Make sure that a CupertinoSearchTextField doesn't crash in 0x0 enviro… (flutter/flutter#179487)
2025-12-05 [email protected] Make sure that a CupertinoPicker doesn't crash in 0x0 environment (flutter/flutter#179258)
2025-12-05 [email protected] Make sure that a CupertinoAlertDialog doesn't crash in 0x0 environment (flutter/flutter#178858)
2025-12-05 [email protected] Make sure that a CupertinoListTileChevron doesn't crash in 0x0 enviro… (flutter/flutter#179165)
2025-12-05 [email protected] Make sure that CupertinoNavigationBar doesn't crash in 0x0 environment (flutter/flutter#179235)
2025-12-05 [email protected] Replace dropdown button with dropdown menu (flutter/flutter#179095)
2025-12-05 [email protected] Make sure that a CupertinoCheckbox doesn't crash in 0x0 environment (flutter/flutter#178630)
2025-12-05 [email protected] Make sure that a CupertinoApp doesn't crash in 0x0 environment (flutter/flutter#178610)
2025-12-05 [email protected] Make sure that a CupertinoButton doesn't crash in 0x0 environment (flutter/flutter#178629)
2025-12-05 [email protected] Make sure that a CupertinoTimerPicker doesn't crash in 0x0 environment (flutter/flutter#178857)
2025-12-05 [email protected] Make sure that a CupertinoScrollbar doesn't crash in 0x0 environment (flutter/flutter#179442)
2025-12-05 [email protected] Roll Dart SDK from 0fcab487446d to f3690c23d422 (1 revision) (flutter/flutter#179517)
2025-12-05 [email protected] Update several comments related to theme normalization (flutter/flutter#179457)
2025-12-05 [email protected] Reimplemented StretchingOverscrollIndicator with Simulation ported from Android 12. (flutter/flutter#173849)
2025-12-05 [email protected] Roll Skia from a31411879251 to e19670f70406 (1 revision) (flutter/flutter#179511)
2025-12-05 [email protected] chore: mark tests as flaky (flutter/flutter#179518)
2025-12-05 [email protected] Roll Dart SDK from 42fe3327abca to 0fcab487446d (3 revisions) (flutter/flutter#179506)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose
...
reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
…ter#179355)

## What's new?
This pull request makes it so that multi window applications can be
tested via `testWidgets`. This PR implements the following:

- A `_TestWindowingOwner` that is used by the
`TestWidgetsFlutterBinding`
- A `_TestRegularWindowController` implementation
- A `_TestDialogWindowController` implementation
- A `_TestFlutterView` and `_TestDisplay` for use by the controllers
- Proper `isActivated` status across controllers
- Proper minimization, maximization, and fullscreen status
- Proper sizing (based on constraints)
- Using the new testing abilities in the multiple windows example app

I have purposefully not implemented tooltip windows yet, as they are
still awaiting an implementation in Win32 to be useful.

## 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.
github-merge-queue bot pushed a commit that referenced this pull request Dec 11, 2025
Reverts #176063

Fixes: #179667

Git bisect:
```
❯ git bisect log
# bad: [5b74a3b] Check for a null cached image in SingleFrameCodec::getNextFrame (#179483)
# good: [66dd93f] Bump engine version for Flutter 3.38.4 stable hotfix. (#179424)
git bisect start 'master' 'flutter-3.38-candidate.0'
# good: [df87ee3] Roll Skia from d10a0d877ff4 to ea7cdbc6b986 (15 revisions) (#176686)
git bisect good df87ee3
# good: [951b25d] Check for devicectl launch logs from std and file (#178167)
git bisect good 951b25d
# good: [337bbfb] Potentially fixing the flakiness in win32 windowing tests, but it needs some running (#178499)
git bisect good 337bbfb
# good: [8e952d6] Roll Skia from c20f797ab6f9 to 81a9a0751f00 (5 revisions) (#179417)
git bisect good 8e952d6
# good: [723fec5] Roll Skia from e19670f70406 to dccd48c6c6ab (6 revisions) (#179524)
git bisect good 723fec5
# bad: [96c6525] Roll Dart SDK from 3c07646cdcb9 to 019cb923bf62 (1 revision) (#179595)
git bisect bad 96c6525
# good: [4000ce2] Implementation of `TestWindowingOwner` for testing multi-window (#179355)
git bisect good 4000ce2
# good: [26f311c] Roll Dart SDK from 75899721aa42 to 3c07646cdcb9 (1 revision) (#179587)
git bisect good 26f311c
# bad: [8cc9fee] Roll Skia from b1936c760645 to 00e6fc407968 (5 revisions) (#179589)
git bisect bad 8cc9fee
# bad: [b37b6fa] Change GenerateFilledArcStrip to use non-overlapping triangles (#179292)
git bisect bad b37b6fa
# bad: [f197a3a] Android implementation of content sizing (#176063)
git bisect bad f197a3a
# first bad commit: [f197a3a] Android implementation of content sizing (#176063)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: tests "flutter test", flutter_test, or one of our tests d: examples Sample code and demos framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants