Skip to content

Commit

Permalink
Add more CFE tests for server
Browse files Browse the repository at this point in the history
Change-Id: I51b36a988c83e2f20f3e76d01fdb09644c2c2ce2
Reviewed-on: https://dart-review.googlesource.com/68760
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
  • Loading branch information
bwilkerson authored and commit-bot@chromium.org committed Aug 8, 2018
1 parent 1cd9175 commit 6137511
Show file tree
Hide file tree
Showing 28 changed files with 2,386 additions and 36 deletions.
27 changes: 27 additions & 0 deletions pkg/analysis_server/test/abstract_context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,33 @@ class _IsTestGroup {
return source;
}

/**
* Call a test that we think will fail.
*
* Ensure that we return any thrown exception correctly (avoiding the
* package:test zone error handler).
*/
Future callFailingTest(Future Function() expectedFailingTestFn) {
final Completer completer = new Completer();

try {
runZoned(
() async => await expectedFailingTestFn(),
onError: (error) {
completer.completeError(error);
},
).then((result) {
completer.complete(result);
}).catchError((error) {
completer.completeError(error);
});
} catch (error) {
completer.completeError(error);
}

return completer.future;
}

/**
* Re-configure the driver. This is necessary, for example, after defining a
* new package that test code will reference.
Expand Down
Loading

0 comments on commit 6137511

Please sign in to comment.