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

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

Issue 530033002: Use a more precise type for "object" in analysis server API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 75d54a92bf000c0519a6ca39b8fc4de5d0396d1e..273d501ec5ea591ef84cf287722d9498f391df8d 100644
--- a/pkg/analysis_server/test/edit/refactoring_test.dart
+++ b/pkg/analysis_server/test/edit/refactoring_test.dart
@@ -29,7 +29,8 @@ class ExtractLocalVariableTest extends _AbstractGetRefactoring_Test {
Future<Response> sendExtractRequest(int offset, int length, String name,
bool extractAll) {
RefactoringKind kind = RefactoringKind.EXTRACT_LOCAL_VARIABLE;
- Object options = new ExtractLocalVariableOptions(name, extractAll);
+ Map options = name != null ? new ExtractLocalVariableOptions(name,
+ extractAll).toJson() : null;
return sendRequest(kind, offset, length, options, false);
}
@@ -116,7 +117,8 @@ main() {
return getRefactoringResult(() {
return sendStringSuffixRequest('getSelectedItem()', ';', null, true);
}).then((result) {
- ExtractLocalVariableFeedback feedback = result.feedback;
+ ExtractLocalVariableFeedback feedback =
+ new ExtractLocalVariableFeedback.fromRefactoringResult(result);
expect(
feedback.names,
unorderedEquals(['treeItem', 'item', 'selectedItem']));
@@ -134,7 +136,8 @@ main() {
return getRefactoringResult(() {
return sendStringRequest('1 + 2', 'res', true);
}).then((result) {
- ExtractLocalVariableFeedback feedback = result.feedback;
+ ExtractLocalVariableFeedback feedback =
+ new ExtractLocalVariableFeedback.fromRefactoringResult(result);
expect(feedback.offsets, [findOffset('1 + 2'), findOffset('1 + 2')]);
expect(feedback.lengths, [5, 6]);
});
@@ -333,7 +336,7 @@ class RenameTest extends _AbstractGetRefactoring_Test {
findOffset(search),
0,
validateOnly,
- options: new RenameOptions(newName)).toRequest('0');
+ options: new RenameOptions(newName).toJson()).toRequest('0');
return serverChannel.sendRequest(request);
}
@@ -518,7 +521,8 @@ main() {
return getRefactoringResult(() {
return sendRenameRequest('st v;', 'NewName');
}).then((result) {
- RenameFeedback feedback = result.feedback;
+ RenameFeedback feedback =
+ new RenameFeedback.fromRefactoringResult(result);
expect(feedback, isNotNull);
expect(feedback.offset, findOffset('Test v;'));
expect(feedback.length, 'Test'.length);
@@ -694,7 +698,7 @@ class _AbstractGetRefactoring_Test extends AbstractAnalysisTest {
}
Future<Response> sendRequest(RefactoringKind kind, int offset, int length,
- Object options, [bool validateOnly = false]) {
+ Map options, [bool validateOnly = false]) {
Request request = new EditGetRefactoringParams(
kind,
testFile,
« no previous file with comments | « pkg/analysis_server/lib/src/services/json.dart ('k') | pkg/analysis_server/tool/spec/codegen_dart_protocol.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698