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

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

Issue 816133002: Improve tests for refactoring exceptions. Catch initial exceptions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use runZoned(). 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/edit/edit_domain.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 1ddcab6c479e61f84ee83cf9ba8a3080f3c7c4f7..9f4fa11c04ce21a0d009299f7bd7baafc255598d 100644
--- a/pkg/analysis_server/test/edit/refactoring_test.dart
+++ b/pkg/analysis_server/test/edit/refactoring_test.dart
@@ -265,7 +265,9 @@ class ExtractLocalVariableTest extends _AbstractGetRefactoring_Test {
}
void tearDown() {
- test_simulateRefactoringException = false;
+ test_simulateRefactoringException_init = false;
+ test_simulateRefactoringException_final = false;
+ test_simulateRefactoringException_change = false;
super.tearDown();
}
@@ -362,8 +364,8 @@ main() {
});
}
- test_serverError() {
- test_simulateRefactoringException = true;
+ test_serverError_change() {
+ test_simulateRefactoringException_change = true;
addTestFile('''
main() {
print(1 + 2);
@@ -372,6 +374,37 @@ main() {
return waitForTasksFinished().then((_) {
return sendStringRequest('1 + 2', 'res', true).then((response) {
expect(response.error, isNotNull);
+ expect(response.error.code, RequestErrorCode.SERVER_ERROR);
+ });
+ });
+ }
+
+ test_serverError_final() {
+ test_simulateRefactoringException_final = true;
+ addTestFile('''
+main() {
+ print(1 + 2);
+}
+''');
+ return waitForTasksFinished().then((_) {
+ return sendStringRequest('1 + 2', 'res', true).then((response) {
+ expect(response.error, isNotNull);
+ expect(response.error.code, RequestErrorCode.SERVER_ERROR);
+ });
+ });
+ }
+
+ test_serverError_init() {
+ test_simulateRefactoringException_init = true;
+ addTestFile('''
+main() {
+ print(1 + 2);
+}
+''');
+ return waitForTasksFinished().then((_) {
+ return sendStringRequest('1 + 2', 'res', true).then((response) {
+ expect(response.error, isNotNull);
+ expect(response.error.code, RequestErrorCode.SERVER_ERROR);
});
});
}
« no previous file with comments | « pkg/analysis_server/lib/src/edit/edit_domain.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698