Merge pull request #99 from jonsamwell/close-driver-error-fix

Close driver error fix
This commit is contained in:
Jon Samwell 2020-11-24 13:28:43 +11:00 committed by GitHub
commit 956b2c268b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 14 deletions

View File

@ -45,21 +45,13 @@ class FlutterWorld extends World {
}) async {
try {
if (_driver != null) {
await _driver
.waitUntilNoTransientCallbacks(timeout: timeout)
.catchError((e, st) {
// Avoid an unhandled error.
print(
'Error waiting for no transient callbacks from Flutter driver:\n\n`$e`\n\n$st');
});
await _driver.close().catchError((e, st) {
// Avoid an unhandled error.
print('Error closing Flutter driver:\n\n`$e`\n\n$st');
});
await _driver.close().catchError(
(e, st) {
// Avoid an unhandled error
return null;
},
);
}
} catch (e, st) {
print('Error closing Flutter driver:\n\n`$e`\n\n$st');
} finally {
_driver = null;
}