Skip to content

Commit bfc9041

Browse files
authored
No longer exiting the application when the RegularWindow is destroyed + resolving the window created promise after runWidget (#181339)
This potentially fixes #177715 by: 1. Relying on the test framework to close the app 2. Completing the `windowCreated` future following `runWidget` when everything is _actually_ ready to go ## 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.
1 parent 9ca1e1d commit bfc9041

1 file changed

Lines changed: 3 additions & 13 deletions

File tree

  • dev/integration_tests/windowing_test/lib

dev/integration_tests/windowing_test/lib/main.dart

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,16 @@
33
// found in the LICENSE file.
44

55
// ignore_for_file: invalid_use_of_internal_member
6+
// ignore_for_file: implementation_imports
67

78
import 'dart:async';
89
import 'dart:convert';
9-
import 'dart:io';
1010

1111
import 'package:flutter/foundation.dart';
1212
import 'package:flutter/material.dart';
1313
import 'package:flutter/src/widgets/_window.dart';
1414
import 'package:flutter_driver/driver_extension.dart';
1515

16-
class _MainRegularWindowControllerDelegate
17-
extends RegularWindowControllerDelegate {
18-
@override
19-
void onWindowDestroyed() {
20-
super.onWindowDestroyed();
21-
22-
exit(0);
23-
}
24-
}
25-
2616
late final RegularWindowController controller;
2717
final ValueNotifier<DialogWindowController?> dialogController = ValueNotifier(
2818
null,
@@ -180,11 +170,11 @@ void main() {
180170
controller = RegularWindowController(
181171
preferredSize: Size(640, 480),
182172
title: 'Integration Test',
183-
delegate: _MainRegularWindowControllerDelegate(),
173+
delegate: RegularWindowControllerDelegate(),
184174
);
185-
windowCreated.complete();
186175

187176
runWidget(RegularWindow(controller: controller, child: MyApp()));
177+
windowCreated.complete();
188178
}
189179

190180
class MyApp extends StatelessWidget {

0 commit comments

Comments
 (0)