Revert elimination of Dart 1 (#18460)

fuchsia_tester.dart still assumes Dart 1. Previously, it ran tests directly
from source, flutter_platform.dart automatically runs a kernel compile when
operating in Dart 2 mode, but this assumes a functional Dart SDK is available
in the artifacts directly, and fuchsia_tester.dart mocks out the artifacts
directory with an empty temp dir.

Remaining work is:
1. Get the frontend server building as a dependency on Fuchsia.
2. Patch fuchsia_tester.dart to use a valid Dart SDK and frontend server.

This also reverts migration to Dart 2 typedef syntax.

This reverts commit 6c56bb2. (#18362)
This reverts commit 3daebd0. (#18316)
This commit is contained in:
Chris Bracken
2018-06-13 12:46:39 -07:00
committed by GitHub
parent 210e2fa333
commit 2ae48845a8
171 changed files with 1247 additions and 439 deletions

View File

@@ -9,10 +9,10 @@ import 'package:meta/meta.dart';
import 'all_elements.dart';
/// Signature for [CommonFinders.byWidgetPredicate].
typedef WidgetPredicate = bool Function(Widget widget);
typedef bool WidgetPredicate(Widget widget);
/// Signature for [CommonFinders.byElementPredicate].
typedef ElementPredicate = bool Function(Element element);
typedef bool ElementPredicate(Element element);
/// Some frequently used widget [Finder]s.
const CommonFinders find = const CommonFinders._();

View File

@@ -636,7 +636,7 @@ class _HasGoodToStringDeep extends Matcher {
///
/// This makes it useful for comparing numbers, [Color]s, [Offset]s and other
/// sets of value for which a metric space is defined.
typedef DistanceFunction<T> = num Function(T a, T b);
typedef num DistanceFunction<T>(T a, T b);
/// The type of a union of instances of [DistanceFunction<T>] for various types
/// T.
@@ -649,7 +649,7 @@ typedef DistanceFunction<T> = num Function(T a, T b);
///
/// Calling an instance of this type must either be done dynamically, or by
/// first casting it to a [DistanceFunction<T>] for some concrete T.
typedef AnyDistanceFunction = num Function(Null a, Null b);
typedef num AnyDistanceFunction(Null a, Null b);
const Map<Type, AnyDistanceFunction> _kStandardDistanceFunctions = const <Type, AnyDistanceFunction>{
Color: _maxComponentColorDistance,

View File

@@ -7,7 +7,7 @@ import 'package:stack_trace/stack_trace.dart' as stack_trace;
import 'package:test/test.dart' as test_package;
/// Signature for the [reportTestException] callback.
typedef TestExceptionReporter = void Function(FlutterErrorDetails details, String testDescription);
typedef void TestExceptionReporter(FlutterErrorDetails details, String testDescription);
/// A function that is called by the test framework when an unexpected error
/// occurred during a test.

View File

@@ -113,10 +113,10 @@ class TestPointer {
/// Signature for a callback that can dispatch events and returns a future that
/// completes when the event dispatch is complete.
typedef EventDispatcher = Future<Null> Function(PointerEvent event, HitTestResult result);
typedef Future<Null> EventDispatcher(PointerEvent event, HitTestResult result);
/// Signature for callbacks that perform hit-testing at a given location.
typedef HitTester = HitTestResult Function(Offset location);
typedef HitTestResult HitTester(Offset location);
/// A class for performing gestures in tests.
///

View File

@@ -24,7 +24,7 @@ import 'test_text_input.dart';
export 'package:test/test.dart' hide expect;
/// Signature for callback to [testWidgets] and [benchmarkWidgets].
typedef WidgetTesterCallback = Future<Null> Function(WidgetTester widgetTester);
typedef Future<Null> WidgetTesterCallback(WidgetTester widgetTester);
/// Runs the [callback] inside the Flutter test environment.
///
@@ -608,7 +608,7 @@ class WidgetTester extends WidgetController implements HitTestDispatcher, Ticker
}
}
typedef _TickerDisposeCallback = void Function(_TestTicker ticker);
typedef void _TickerDisposeCallback(_TestTicker ticker);
class _TestTicker extends Ticker {
_TestTicker(TickerCallback onTick, this._onDispose) : super(onTick);