Revert "Merge pull request #2639 from Hixie/always_specify_types"
This reverts commitf41b3411da, reversing changes made toe33d8d9621. This was a bad check-in due to my mangling uploading a new version of the branch from a different machine. This reverts https://github.com/flutter/flutter/pull/2639 and will be replaced by https://github.com/flutter/flutter/pull/2640
This commit is contained in:
@@ -55,7 +55,7 @@ class FlutterDriver {
|
||||
//
|
||||
// See: https://github.com/dart-lang/sdk/issues/25902
|
||||
if (isolate.pauseEvent is VMResumeEvent) {
|
||||
await new Future<Null>.delayed(new Duration(milliseconds: 300));
|
||||
await new Future.delayed(new Duration(milliseconds: 300));
|
||||
isolate = await vm.isolates.first.loadRunnable();
|
||||
}
|
||||
|
||||
@@ -64,10 +64,10 @@ class FlutterDriver {
|
||||
// Attempts to resume the isolate, but does not crash if it fails because
|
||||
// the isolate is already resumed. There could be a race with other tools,
|
||||
// such as a debugger, any of which could have resumed the isolate.
|
||||
Future<Null> resumeLeniently() {
|
||||
Future resumeLeniently() {
|
||||
_log.trace('Attempting to resume isolate');
|
||||
return isolate.resume().catchError((dynamic e) {
|
||||
const int vmMustBePausedCode = 101;
|
||||
return isolate.resume().catchError((e) {
|
||||
const vmMustBePausedCode = 101;
|
||||
if (e is rpc.RpcException && e.code == vmMustBePausedCode) {
|
||||
// No biggie; something else must have resumed the isolate
|
||||
_log.warning(
|
||||
@@ -87,7 +87,7 @@ class FlutterDriver {
|
||||
_log.trace('Isolate is paused at start.');
|
||||
|
||||
// Waits for a signal from the VM service that the extension is registered
|
||||
Future<Null> waitForServiceExtension() {
|
||||
Future waitForServiceExtension() {
|
||||
return isolate.onExtensionAdded.firstWhere((String extension) {
|
||||
return extension == _kFlutterExtensionMethod;
|
||||
});
|
||||
@@ -96,8 +96,8 @@ class FlutterDriver {
|
||||
// If the isolate is paused at the start, e.g. via the --start-paused
|
||||
// option, then the VM service extension is not registered yet. Wait for
|
||||
// it to be registered.
|
||||
Future<Null> whenResumed = resumeLeniently();
|
||||
Future<Null> whenServiceExtensionReady = Future.any(<Future<dynamic>>[
|
||||
Future whenResumed = resumeLeniently();
|
||||
Future whenServiceExtensionReady = Future.any(<Future>[
|
||||
waitForServiceExtension(),
|
||||
// We will never receive the extension event if the user does not
|
||||
// register it. If that happens time out.
|
||||
@@ -150,7 +150,7 @@ class FlutterDriver {
|
||||
Map<String, String> parameters = <String, String>{'command': command.kind}
|
||||
..addAll(command.serialize());
|
||||
return _appIsolate.invokeExtension(_kFlutterExtensionMethod, parameters)
|
||||
.then((Map<String, dynamic> result) => result, onError: (dynamic error, dynamic stackTrace) {
|
||||
.then((Map<String, dynamic> result) => result, onError: (error, stackTrace) {
|
||||
throw new DriverError(
|
||||
'Failed to fulfill ${command.runtimeType} due to remote error',
|
||||
error,
|
||||
@@ -217,7 +217,7 @@ class FlutterDriver {
|
||||
dynamic value = await evaluator();
|
||||
MatchResult matchResult = match(value, matcher);
|
||||
if (!matchResult.hasMatched) {
|
||||
return new Future<Null>.error(matchResult.mismatchDescription);
|
||||
return new Future.error(matchResult.mismatchDescription);
|
||||
}
|
||||
return value;
|
||||
}, timeout, pauseBetweenRetries);
|
||||
@@ -227,7 +227,7 @@ class FlutterDriver {
|
||||
///
|
||||
/// Returns a [Future] that fires once the connection has been closed.
|
||||
// TODO(yjbanov): cleanup object references
|
||||
Future<Null> close() => _serviceClient.close().then((_) {
|
||||
Future close() => _serviceClient.close().then((_) {
|
||||
// Don't leak vm_service_client-specific objects, if any
|
||||
return null;
|
||||
});
|
||||
@@ -255,10 +255,10 @@ Future<VMServiceClient> _waitAndConnect(String url) async {
|
||||
Stopwatch timer = new Stopwatch();
|
||||
Future<VMServiceClient> attemptConnection() {
|
||||
return VMServiceClient.connect(url)
|
||||
.catchError((dynamic e) async {
|
||||
.catchError((e) async {
|
||||
if (timer.elapsed < const Duration(seconds: 30)) {
|
||||
_log.info('Waiting for application to start');
|
||||
await new Future<Null>.delayed(const Duration(seconds: 1));
|
||||
await new Future.delayed(const Duration(seconds: 1));
|
||||
return attemptConnection();
|
||||
} else {
|
||||
_log.critical(
|
||||
|
||||
@@ -49,7 +49,7 @@ class _TextDescription implements Description {
|
||||
return this;
|
||||
}
|
||||
|
||||
Description addDescriptionOf(dynamic value) {
|
||||
Description addDescriptionOf(value) {
|
||||
if (value is Matcher) {
|
||||
value.describe(this);
|
||||
return this;
|
||||
@@ -58,7 +58,7 @@ class _TextDescription implements Description {
|
||||
}
|
||||
}
|
||||
|
||||
Description addAll(String start, String separator, String end, Iterable<dynamic> list) {
|
||||
Description addAll(String start, String separator, String end, Iterable list) {
|
||||
add(start);
|
||||
if (list.isNotEmpty) {
|
||||
addDescriptionOf(list.first);
|
||||
|
||||
@@ -48,9 +48,9 @@ Future<dynamic> retry(Action action, Duration timeout,
|
||||
if (success)
|
||||
return result;
|
||||
else if (lastError != null)
|
||||
return new Future<Null>.error(lastError, lastStackTrace);
|
||||
return new Future.error(lastError, lastStackTrace);
|
||||
else
|
||||
return new Future<Null>.error('Retry timed out');
|
||||
return new Future.error('Retry timed out');
|
||||
}
|
||||
|
||||
/// A function that produces a [Stopwatch].
|
||||
|
||||
Reference in New Issue
Block a user