common.dart 944 Bytes
Newer Older
Ian Hickson's avatar
Ian Hickson committed
1
// Copyright 2014 The Flutter Authors. All rights reserved.
2 3 4
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5 6
import 'dart:io';

Dan Field's avatar
Dan Field committed
7
import 'package:flutter_driver/src/common/error.dart';
8
import 'package:test_api/test_api.dart'; // ignore: deprecated_member_use
9

10
export 'package:test_api/fake.dart'; // ignore: deprecated_member_use
11
export 'package:test_api/test_api.dart'; // ignore: deprecated_member_use
12 13 14 15 16 17 18 19

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) {
20
    driverLog('test', 'Failed to delete ${directory.path}: $error');
21
  }
22
}
Dan Field's avatar
Dan Field committed
23 24 25

/// Matcher for functions that throw [DriverError].
final Matcher throwsDriverError = throwsA(isA<DriverError>());