| 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.navigation; | 5 library test.domain.analysis.notification.navigation; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/analysis_server.dart'; | 9 import 'package:analysis_server/src/analysis_server.dart'; |
| 10 import 'package:analysis_server/src/constants.dart'; | 10 import 'package:analysis_server/src/constants.dart'; |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 class AAA { | 227 class AAA { |
| 228 int fff = 123; | 228 int fff = 123; |
| 229 AAA(this.fff); | 229 AAA(this.fff); |
| 230 } | 230 } |
| 231 '''); | 231 '''); |
| 232 return prepareNavigation(() { | 232 return prepareNavigation(() { |
| 233 assertHasRegionTarget('fff);', 'fff = 123'); | 233 assertHasRegionTarget('fff);', 'fff = 123'); |
| 234 }); | 234 }); |
| 235 } | 235 } |
| 236 | 236 |
| 237 test_afterAnalysis() { |
| 238 addTestFile(''' |
| 239 class AAA {} |
| 240 AAA aaa; |
| 241 '''); |
| 242 return waitForTasksFinished().then((_) { |
| 243 return prepareNavigation(() { |
| 244 assertHasRegionTarget('AAA aaa;', 'AAA {}'); |
| 245 }); |
| 246 }); |
| 247 } |
| 248 |
| 237 test_identifier_resolved() { | 249 test_identifier_resolved() { |
| 238 addTestFile(''' | 250 addTestFile(''' |
| 239 class AAA {} | 251 class AAA {} |
| 240 main() { | 252 main() { |
| 241 AAA aaa = null; | 253 AAA aaa = null; |
| 242 print(aaa); | 254 print(aaa); |
| 243 } | 255 } |
| 244 '''); | 256 '''); |
| 245 return prepareNavigation(() { | 257 return prepareNavigation(() { |
| 246 assertHasRegionTarget('AAA aaa', 'AAA {}'); | 258 assertHasRegionTarget('AAA aaa', 'AAA {}'); |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 } | 466 } |
| 455 | 467 |
| 456 | 468 |
| 457 class _NavigationTarget { | 469 class _NavigationTarget { |
| 458 final String file; | 470 final String file; |
| 459 final int offset; | 471 final int offset; |
| 460 final int length; | 472 final int length; |
| 461 | 473 |
| 462 _NavigationTarget(this.file, this.offset, this.length); | 474 _NavigationTarget(this.file, this.offset, this.length); |
| 463 } | 475 } |
| OLD | NEW |