@@ -31,39 +31,19 @@ import '../../test_infra/matchers/matchers.dart';
3131// reduced to under 1 second without introducing flakes.
3232const inspectorChangeSettleTime = Duration (seconds: 2 );
3333
34- void _copyDirectorySync (Directory source, Directory destination) {
35- if (! destination.existsSync ()) {
36- destination.createSync (recursive: true );
37- }
38- for (final entity in source.listSync ()) {
39- final newPath = p.join (destination.path, p.basename (entity.path));
40- if (entity is Directory ) {
41- _copyDirectorySync (entity, Directory (newPath));
42- } else if (entity is File ) {
43- entity.copySync (newPath);
44- }
45- }
46- }
4734
4835void main () {
4936 // We need to use real async in this test so we need to use this binding.
5037 initializeLiveTestWidgetsFlutterBindingWithAssets ();
5138 const windowSize = Size (2600.0 , 1200.0 );
5239
53- // We copy the fixture app to a temporary directory because the
54- // auto-refresh tests modify lib/main.dart in-place. If this used the shared
55- // 'inspector_app' fixture, it could cause flaky test failures in other tests
56- // (like inspector_service_test.dart) that run in parallel.
57- final tempAppDir =
58- 'test/test_infra/fixtures/inspector_app_temp_${DateTime .now ().millisecondsSinceEpoch }' ;
59- _copyDirectorySync (
60- Directory ('test/test_infra/fixtures/inspector_app' ),
61- Directory (tempAppDir),
62- );
63-
40+ // The auto-refresh tests modify lib/main.dart in-place.
41+ // We use `useTempDirectory: true` (default in FlutterTestEnvironment) to
42+ // copy the fixture app to a temporary directory. This prevents flaky test
43+ // failures in other tests (like inspector_service_test.dart) that run in parallel.
6444 final env = FlutterTestEnvironment (
6545 const FlutterRunConfiguration (withDebugger: true ),
66- testAppDirectory: tempAppDir ,
46+ testAppDirectory: 'test/test_infra/fixtures/inspector_app' ,
6747 );
6848
6949 env.afterEverySetup = () async {
@@ -92,10 +72,6 @@ void main() {
9272
9373 tearDownAll (() {
9474 env.finalTeardown ();
95- final dir = Directory (tempAppDir);
96- if (dir.existsSync ()) {
97- dir.deleteSync (recursive: true );
98- }
9975 });
10076
10177 group ('screenshot tests' , () {
0 commit comments