mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Closes: - https://github.com/flutter/flutter/issues/138434 We will catch any errors while attempting to clear the temp directories that don't exist for the `FontConfigManager` class
This commit is contained in:
parent
7417c4eaeb
commit
2e9cb0aa71
@ -34,7 +34,11 @@ class FontConfigManager {
|
||||
Future<void> dispose() async {
|
||||
if (_fontsDirectory != null) {
|
||||
globals.printTrace('Deleting ${_fontsDirectory!.path}...');
|
||||
await _fontsDirectory!.delete(recursive: true);
|
||||
try {
|
||||
await _fontsDirectory!.delete(recursive: true);
|
||||
} on FileSystemException {
|
||||
// Silently exit
|
||||
}
|
||||
_fontsDirectory = null;
|
||||
}
|
||||
}
|
||||
|
@ -50,6 +50,18 @@ void main() {
|
||||
uriConverter: (String input) => '$input/converted',
|
||||
);
|
||||
|
||||
testUsingContext('Missing dir error caught for FontConfigManger.dispose', () async {
|
||||
final FontConfigManager fontConfigManager = FontConfigManager();
|
||||
|
||||
final Directory fontsDirectory = fileSystem.file(fontConfigManager.fontConfigFile).parent;
|
||||
fontsDirectory.deleteSync(recursive: true);
|
||||
|
||||
await fontConfigManager.dispose();
|
||||
}, overrides: <Type, Generator>{
|
||||
FileSystem: () => fileSystem,
|
||||
ProcessManager: () => processManager,
|
||||
});
|
||||
|
||||
group('The FLUTTER_TEST environment variable is passed to the test process', () {
|
||||
setUp(() {
|
||||
processManager = FakeProcessManager.list(<FakeCommand>[]);
|
||||
|
Loading…
Reference in New Issue
Block a user