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

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

Issue 2879273002: Make server use the common protocol classes (Closed)
Patch Set: Created 3 years, 7 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/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 264fe0b3a70634e3b02ce2c07c1623844b34ebad..ddcc2de67d9ce2304a834134ebc7e9ce7c52cb26 100644
--- a/pkg/analysis_server/test/edit/refactoring_test.dart
+++ b/pkg/analysis_server/test/edit/refactoring_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library test.edit.refactoring;
-
import 'dart:async';
import 'package:analysis_server/protocol/protocol.dart';
@@ -11,6 +9,7 @@ import 'package:analysis_server/protocol/protocol_generated.dart';
import 'package:analysis_server/src/edit/edit_domain.dart';
import 'package:analysis_server/src/services/index/index.dart';
import 'package:analyzer/task/dart.dart';
+import 'package:analyzer_plugin/protocol/protocol_common.dart';
import 'package:plugin/manager.dart';
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
@@ -362,7 +361,7 @@ main() {
''');
}
- test_names() {
+ test_names() async {
addTestFile('''
class TreeItem {}
TreeItem getSelectedItem() => null;
@@ -370,37 +369,35 @@ main() {
var a = getSelectedItem();
}
''');
- return getRefactoringResult(() {
+ EditGetRefactoringResult result = await getRefactoringResult(() {
return sendStringSuffixRequest('getSelectedItem()', ';', null, true);
- }).then((result) {
- ExtractLocalVariableFeedback feedback = result.feedback;
- expect(feedback.names,
- unorderedEquals(['treeItem', 'item', 'selectedItem']));
- expect(result.change, isNull);
});
+ ExtractLocalVariableFeedback feedback = result.feedback;
+ expect(
+ feedback.names, unorderedEquals(['treeItem', 'item', 'selectedItem']));
+ expect(result.change, isNull);
}
- test_nameWarning() {
+ test_nameWarning() async {
addTestFile('''
main() {
print(1 + 2);
}
''');
- return getRefactoringResult(() {
+ EditGetRefactoringResult result = await getRefactoringResult(() {
return sendStringRequest('1 + 2', 'Name', true);
- }).then((result) {
- assertResultProblemsWarning(result.optionsProblems,
- 'Variable name should start with a lowercase letter.');
- // ...but there is still a change
- assertTestRefactoringResult(
- result,
- '''
+ });
+ assertResultProblemsWarning(result.optionsProblems,
+ 'Variable name should start with a lowercase letter.');
+ // ...but there is still a change
+ assertTestRefactoringResult(
+ result,
+ '''
main() {
var Name = 1 + 2;
print(Name);
}
''');
- });
}
test_offsetsLengths() {
« no previous file with comments | « pkg/analysis_server/test/edit/organize_directives_test.dart ('k') | pkg/analysis_server/test/edit/sort_members_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698