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

Side by Side Diff: pkg/analysis_server/test/edit/refactoring_test.dart

Issue 749173002: Issue 21613. Fix for renaming FieldFormalParameterElement. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analysis_server/lib/src/edit/edit_domain.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.edit.refactoring; 5 library test.edit.refactoring;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/edit/edit_domain.dart'; 9 import 'package:analysis_server/src/edit/edit_domain.dart';
10 import 'package:analysis_server/src/protocol.dart'; 10 import 'package:analysis_server/src/protocol.dart';
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 } 1064 }
1065 '''); 1065 ''');
1066 }); 1066 });
1067 }); 1067 });
1068 } 1068 }
1069 1069
1070 test_classMember_field() { 1070 test_classMember_field() {
1071 addTestFile(''' 1071 addTestFile('''
1072 class A { 1072 class A {
1073 var test = 0; 1073 var test = 0;
1074 A(this.test);
1074 main() { 1075 main() {
1075 print(test); 1076 print(test);
1076 } 1077 }
1077 } 1078 }
1078 '''); 1079 ''');
1079 return assertSuccessfulRefactoring(() { 1080 return assertSuccessfulRefactoring(() {
1080 return sendRenameRequest('test = 0', 'newName'); 1081 return sendRenameRequest('test = 0', 'newName');
1081 }, ''' 1082 }, '''
1082 class A { 1083 class A {
1083 var newName = 0; 1084 var newName = 0;
1085 A(this.newName);
1084 main() { 1086 main() {
1085 print(newName); 1087 print(newName);
1086 } 1088 }
1089 }
1090 ''');
1091 }
1092
1093 test_classMember_field_onFieldFormalParameter() {
1094 addTestFile('''
1095 class A {
1096 var test = 0;
1097 A(this.test);
1098 main() {
1099 print(test);
1100 }
1101 }
1102 ''');
1103 return assertSuccessfulRefactoring(() {
1104 return sendRenameRequest('test);', 'newName');
1105 }, '''
1106 class A {
1107 var newName = 0;
1108 A(this.newName);
1109 main() {
1110 print(newName);
1111 }
1087 } 1112 }
1088 '''); 1113 ''');
1089 } 1114 }
1090 1115
Paul Berry 2014/11/24 14:31:17 I think we need one additional test to make sure t
scheglov 2014/11/24 16:00:14 Done.
1091 test_classMember_getter() { 1116 test_classMember_getter() {
1092 addTestFile(''' 1117 addTestFile('''
1093 class A { 1118 class A {
1094 get test => 0; 1119 get test => 0;
1095 main() { 1120 main() {
1096 print(test); 1121 print(test);
1097 } 1122 }
1098 } 1123 }
1099 '''); 1124 ''');
1100 return assertSuccessfulRefactoring(() { 1125 return assertSuccessfulRefactoring(() {
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
1569 } 1594 }
1570 1595
1571 @override 1596 @override
1572 void setUp() { 1597 void setUp() {
1573 super.setUp(); 1598 super.setUp();
1574 server.handlers = [new EditDomainHandler(server),]; 1599 server.handlers = [new EditDomainHandler(server),];
1575 createProject(); 1600 createProject();
1576 handler = new EditDomainHandler(server); 1601 handler = new EditDomainHandler(server);
1577 } 1602 }
1578 } 1603 }
OLDNEW
« 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