Index: pkg/analysis_server/test/reflective_tests.dart |
diff --git a/pkg/analysis_server/test/reflective_tests.dart b/pkg/analysis_server/test/reflective_tests.dart |
index 80c9073be80c226297324fab54b635e8b20d7af2..f421e6c393ebf1ebc3ba6cdbd3d5a489e80518b4 100644 |
--- a/pkg/analysis_server/test/reflective_tests.dart |
+++ b/pkg/analysis_server/test/reflective_tests.dart |
@@ -10,7 +10,6 @@ import 'dart:async'; |
import 'package:unittest/unittest.dart'; |
- |
/** |
* Runs test methods existing in the given [type]. |
* |
@@ -29,13 +28,11 @@ import 'package:unittest/unittest.dart'; |
*/ |
void runReflectiveTests(Type type) { |
ClassMirror classMirror = reflectClass(type); |
- if (!classMirror.metadata.any( |
- (InstanceMirror annotation) => |
- annotation.type.reflectedType == ReflectiveTest)) { |
+ if (!classMirror.metadata.any((InstanceMirror annotation) => |
+ annotation.type.reflectedType == ReflectiveTest)) { |
String name = MirrorSystem.getName(classMirror.qualifiedName); |
- throw new Exception( |
- 'Class $name must have annotation "@reflectiveTest" ' |
- 'in order to be run by runReflectiveTests.'); |
+ throw new Exception('Class $name must have annotation "@reflectiveTest" ' |
+ 'in order to be run by runReflectiveTests.'); |
} |
String className = MirrorSystem.getName(classMirror.simpleName); |
group(className, () { |
@@ -74,13 +71,11 @@ void runReflectiveTests(Type type) { |
}); |
} |
- |
Future _invokeSymbolIfExists(InstanceMirror instanceMirror, Symbol symbol) { |
var invocationResult = null; |
try { |
invocationResult = instanceMirror.invoke(symbol, []).reflectee; |
- } on NoSuchMethodError catch (e) { |
- } |
+ } on NoSuchMethodError catch (e) {} |
if (invocationResult is Future) { |
return invocationResult; |
} else { |
@@ -88,7 +83,6 @@ Future _invokeSymbolIfExists(InstanceMirror instanceMirror, Symbol symbol) { |
} |
} |
- |
/** |
* Run a test that is expected to fail, and confirm that it fails. |
* |
@@ -105,21 +99,13 @@ Future _runFailingTest(ClassMirror classMirror, Symbol symbol) { |
}, onError: (_) {}); |
} |
- |
_runTest(ClassMirror classMirror, Symbol symbol) { |
InstanceMirror instanceMirror = classMirror.newInstance(new Symbol(''), []); |
- return _invokeSymbolIfExists( |
- instanceMirror, |
- #setUp).then( |
- (_) => |
- instanceMirror.invoke( |
- symbol, |
- [ |
- ]).reflectee).whenComplete( |
- () => _invokeSymbolIfExists(instanceMirror, #tearDown)); |
+ return _invokeSymbolIfExists(instanceMirror, #setUp) |
+ .then((_) => instanceMirror.invoke(symbol, []).reflectee) |
+ .whenComplete(() => _invokeSymbolIfExists(instanceMirror, #tearDown)); |
} |
- |
/** |
* A marker annotation used to instruct dart2js to keep reflection information |
* for the annotated classes. |