Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(508)

Unified Diff: pkg/analysis_server/test/reflective_tests.dart

Issue 969113002: Reformat (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.
« no previous file with comments | « pkg/analysis_server/test/protocol_test.dart ('k') | pkg/analysis_server/test/search/abstract_search_domain.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698