2019-11-27 23:04:02 +00:00
|
|
|
// Copyright 2014 The Flutter Authors. All rights reserved.
|
2018-08-15 03:33:58 +00:00
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2018-08-17 20:17:23 +00:00
|
|
|
import 'dart:io';
|
|
|
|
|
2020-01-27 22:36:02 +00:00
|
|
|
import 'package:flutter_driver/src/common/error.dart';
|
2023-04-20 20:55:28 +00:00
|
|
|
import 'package:test/test.dart';
|
2018-08-15 03:33:58 +00:00
|
|
|
|
2023-04-20 20:55:28 +00:00
|
|
|
export 'package:test/fake.dart';
|
|
|
|
export 'package:test/test.dart';
|
2018-08-17 20:17:23 +00:00
|
|
|
|
|
|
|
void tryToDelete(Directory directory) {
|
|
|
|
// This should not be necessary, but it turns out that
|
|
|
|
// on Windows it's common for deletions to fail due to
|
|
|
|
// bogus (we think) "access denied" errors.
|
|
|
|
try {
|
|
|
|
directory.deleteSync(recursive: true);
|
|
|
|
} on FileSystemException catch (error) {
|
2021-10-07 23:48:04 +00:00
|
|
|
driverLog('test', 'Failed to delete ${directory.path}: $error');
|
2018-08-17 20:17:23 +00:00
|
|
|
}
|
2018-12-18 09:05:12 +00:00
|
|
|
}
|
2020-01-27 22:36:02 +00:00
|
|
|
|
|
|
|
/// Matcher for functions that throw [DriverError].
|
|
|
|
final Matcher throwsDriverError = throwsA(isA<DriverError>());
|