flutter_test_config.dart 874 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 7
import 'dart:async';

import 'package:flutter/rendering.dart';
8
import 'package:flutter_test/flutter_test.dart';
9 10 11 12

import '_goldens_io.dart'
  if (dart.library.html) '_goldens_web.dart' as flutter_goldens;

13
Future<void> testExecutable(FutureOr<void> Function() testMain) {
14 15 16 17
  // Enable checks because there are many implementations of [RenderBox] in this
  // package can benefit from the additional validations.
  debugCheckIntrinsicSizes = true;

18 19 20 21 22
  // Make tap() et al fail if the given finder specifies a widget that would not
  // receive the event.
  WidgetController.hitTestWarningShouldBeFatal = true;

  // Enable golden file testing using Skia Gold.
23 24
  return flutter_goldens.testExecutable(testMain);
}