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

Unified Diff: pkg/analysis_server/test/edit/refactoring_test.dart

Issue 815233002: Catch exceptions in refactorings and return them as a SERVER_ERROR. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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/analysis_server/lib/src/protocol.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/edit/refactoring_test.dart
diff --git a/pkg/analysis_server/test/edit/refactoring_test.dart b/pkg/analysis_server/test/edit/refactoring_test.dart
index 814e563b2dc68937e01fe9d2881296622ac8b869..1ddcab6c479e61f84ee83cf9ba8a3080f3c7c4f7 100644
--- a/pkg/analysis_server/test/edit/refactoring_test.dart
+++ b/pkg/analysis_server/test/edit/refactoring_test.dart
@@ -264,6 +264,11 @@ class ExtractLocalVariableTest extends _AbstractGetRefactoring_Test {
return sendExtractRequest(offset, length, name, extractAll);
}
+ void tearDown() {
+ test_simulateRefactoringException = false;
+ super.tearDown();
+ }
+
test_extractAll() {
addTestFile('''
main() {
@@ -356,6 +361,20 @@ main() {
expect(feedback.lengths, [5, 6]);
});
}
+
+ test_serverError() {
+ test_simulateRefactoringException = true;
+ addTestFile('''
+main() {
+ print(1 + 2);
+}
+''');
+ return waitForTasksFinished().then((_) {
+ return sendStringRequest('1 + 2', 'res', true).then((response) {
+ expect(response.error, isNotNull);
+ });
+ });
+ }
}
« no previous file with comments | « pkg/analysis_server/lib/src/protocol.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698