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

Unified Diff: pkg/analyzer/test/src/task/general_test.dart

Issue 1041283002: GetContentTask should catch exceptions and wrap them into AnalysisExceptions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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
« no previous file with comments | « pkg/analyzer/lib/src/task/general.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/general_test.dart
diff --git a/pkg/analyzer/test/src/task/general_test.dart b/pkg/analyzer/test/src/task/general_test.dart
index 664a2d62b9a1c9ccff5b05b0dbd9ee955022559f..a043c84242bc7872ec0911a4c7277869ada7dd8b 100644
--- a/pkg/analyzer/test/src/task/general_test.dart
+++ b/pkg/analyzer/test/src/task/general_test.dart
@@ -66,6 +66,16 @@ class GetContentTaskTest extends EngineTestCase {
expect(task.outputs[CONTENT], 'foo');
expect(task.outputs[MODIFICATION_TIME], 42);
}
+
+ void test_perform_exception() {
+ AnalysisContext context = new _MockContext();
+ Source target = new TestSource();
+ GetContentTask task = new GetContentTask(context, target);
+ when(context.getContents(target)).thenThrow('My exception!');
+ task.perform();
+ expect(task.caughtException, isNotNull);
+ expect(task.outputs, isEmpty);
+ }
}
class _MockContext extends TypedMock implements AnalysisContext {
« no previous file with comments | « pkg/analyzer/lib/src/task/general.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698