|
4 | 4 |
|
5 | 5 | import 'package:file/memory.dart';
|
6 | 6 | import 'package:file_testing/file_testing.dart';
|
| 7 | +import 'package:flutter_tools/src/base/error_handling_io.dart'; |
7 | 8 | import 'package:flutter_tools/src/base/file_system.dart';
|
8 | 9 | import 'package:flutter_tools/src/base/io.dart';
|
9 | 10 | import 'package:flutter_tools/src/base/logger.dart';
|
10 |
| -import 'package:flutter_tools/src/base/signals.dart'; |
| 11 | +import 'package:flutter_tools/src/base/platform.dart'; |
11 | 12 | import 'package:flutter_tools/src/base/version.dart';
|
12 | 13 | import 'package:flutter_tools/src/ios/core_devices.dart';
|
13 | 14 | import 'package:flutter_tools/src/ios/xcodeproj.dart';
|
14 | 15 | import 'package:flutter_tools/src/macos/xcode.dart';
|
| 16 | +import 'package:test/fake.dart'; |
15 | 17 |
|
16 | 18 | import '../../src/common.dart';
|
17 | 19 | import '../../src/fake_process_manager.dart';
|
18 | 20 |
|
19 |
| -class LocalFileSystemFake extends LocalFileSystem { |
20 |
| - LocalFileSystemFake.test({required super.signals}) : super.test(); |
21 |
| - |
| 21 | +class LocalFileSystemFake extends Fake implements LocalFileSystem { |
22 | 22 | MemoryFileSystem memoryFileSystem = MemoryFileSystem.test();
|
23 | 23 |
|
24 | 24 | @override
|
25 | 25 | Directory get systemTempDirectory => memoryFileSystem.systemTempDirectory;
|
| 26 | + |
| 27 | + @override |
| 28 | + Directory directory(dynamic path) => memoryFileSystem.directory(path); |
| 29 | + |
| 30 | + @override |
| 31 | + File file(dynamic path) => memoryFileSystem.file(path); |
| 32 | + |
| 33 | + @override |
| 34 | + Context get path => memoryFileSystem.path; |
| 35 | + |
| 36 | + @override |
| 37 | + Future<void> dispose() async { |
| 38 | + _disposed = true; |
| 39 | + } |
| 40 | + |
| 41 | + @override |
| 42 | + bool get disposed => _disposed; |
| 43 | + |
| 44 | + bool _disposed = false; |
26 | 45 | }
|
27 | 46 |
|
28 | 47 | void main() {
|
@@ -1411,12 +1430,13 @@ invalid JSON
|
1411 | 1430 | });
|
1412 | 1431 |
|
1413 | 1432 | testWithoutContext('Handles file system disposal', () async {
|
1414 |
| - final LocalFileSystem localFs = LocalFileSystemFake.test(signals: Signals.test()); |
| 1433 | + final LocalFileSystem localFs = LocalFileSystemFake(); |
| 1434 | + final ErrorHandlingFileSystem fs = ErrorHandlingFileSystem(delegate: localFs, platform: FakePlatform()); |
1415 | 1435 | deviceControl = IOSCoreDeviceControl(
|
1416 | 1436 | logger: logger,
|
1417 | 1437 | processManager: fakeProcessManager,
|
1418 | 1438 | xcode: xcode,
|
1419 |
| - fileSystem: localFs, |
| 1439 | + fileSystem: fs, |
1420 | 1440 | );
|
1421 | 1441 | final Directory tempDir = localFs.systemTempDirectory
|
1422 | 1442 | .childDirectory('core_devices.rand0');
|
|
0 commit comments