| OLD | NEW |
| 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.domain.analysis.notification.outline; | 5 library test.domain.analysis.notification.outline; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:mirrors'; | 8 import 'dart:mirrors'; |
| 9 | 9 |
| 10 import 'package:analysis_server/src/analysis_server.dart'; | 10 import 'package:analysis_server/src/analysis_server.dart'; |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 expect(outline.name, "B"); | 196 expect(outline.name, "B"); |
| 197 expect(outline.nameOffset, testCode.indexOf("B(int p);")); | 197 expect(outline.nameOffset, testCode.indexOf("B(int p);")); |
| 198 expect(outline.nameLength, "B".length); | 198 expect(outline.nameLength, "B".length); |
| 199 expect(outline.parameters, "(int p)"); | 199 expect(outline.parameters, "(int p)"); |
| 200 expect(outline.returnType, isNull); | 200 expect(outline.returnType, isNull); |
| 201 } | 201 } |
| 202 } | 202 } |
| 203 }); | 203 }); |
| 204 } | 204 } |
| 205 | 205 |
| 206 test_afterAnalysis() { |
| 207 addTestFile(''' |
| 208 class AAA { |
| 209 } |
| 210 class BBB { |
| 211 } |
| 212 '''); |
| 213 return waitForTasksFinished().then((_) { |
| 214 expect(outline, isNull); |
| 215 return prepareOutline(() { |
| 216 _Outline unitOutline = outline; |
| 217 List<_Outline> outlines = unitOutline.children; |
| 218 expect(outlines, hasLength(2)); |
| 219 }); |
| 220 }); |
| 221 } |
| 222 |
| 206 test_sourceRange_inClass() { | 223 test_sourceRange_inClass() { |
| 207 addTestFile(''' | 224 addTestFile(''' |
| 208 class A { // leftA | 225 class A { // leftA |
| 209 int methodA() {} // endA | 226 int methodA() {} // endA |
| 210 int methodB() {} // endB | 227 int methodB() {} // endB |
| 211 } | 228 } |
| 212 '''); | 229 '''); |
| 213 return prepareOutline(() { | 230 return prepareOutline(() { |
| 214 _Outline unitOutline = outline; | 231 _Outline unitOutline = outline; |
| 215 List<_Outline> outlines = unitOutline.children[0].children; | 232 List<_Outline> outlines = unitOutline.children[0].children; |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 map[PARAMETERS], map[RETURN_TYPE]); | 695 map[PARAMETERS], map[RETURN_TYPE]); |
| 679 List<Map<String, Object>> childrenMaps = map[CHILDREN]; | 696 List<Map<String, Object>> childrenMaps = map[CHILDREN]; |
| 680 if (childrenMaps != null) { | 697 if (childrenMaps != null) { |
| 681 childrenMaps.forEach((childMap) { | 698 childrenMaps.forEach((childMap) { |
| 682 outline.children.add(new _Outline.fromJson(childMap)); | 699 outline.children.add(new _Outline.fromJson(childMap)); |
| 683 }); | 700 }); |
| 684 } | 701 } |
| 685 return outline; | 702 return outline; |
| 686 } | 703 } |
| 687 } | 704 } |
| OLD | NEW |