| 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; | 5 library test.domain.analysis; |
| 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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 } | 571 } |
| 572 | 572 |
| 573 test_setRoots_packages() { | 573 test_setRoots_packages() { |
| 574 // prepare package | 574 // prepare package |
| 575 String pkgFile = '/packages/pkgA/libA.dart'; | 575 String pkgFile = '/packages/pkgA/libA.dart'; |
| 576 resourceProvider.newFile(pkgFile, ''' | 576 resourceProvider.newFile(pkgFile, ''' |
| 577 library lib_a; | 577 library lib_a; |
| 578 class A {} | 578 class A {} |
| 579 '''); | 579 '''); |
| 580 packageMapProvider.packageMap['pkgA'] = | 580 packageMapProvider.packageMap['pkgA'] = |
| 581 resourceProvider.getResource('/packages/pkgA'); | 581 [resourceProvider.getResource('/packages/pkgA')]; |
| 582 addTestFile(''' | 582 addTestFile(''' |
| 583 import 'package:pkgA/libA.dart'; | 583 import 'package:pkgA/libA.dart'; |
| 584 main(A a) { | 584 main(A a) { |
| 585 } | 585 } |
| 586 '''); | 586 '''); |
| 587 // create project and wait for analysis | 587 // create project and wait for analysis |
| 588 createProject(); | 588 createProject(); |
| 589 return waitForTasksFinished().then((_) { | 589 return waitForTasksFinished().then((_) { |
| 590 // if 'package:pkgA/libA.dart' was resolved, then there are no errors | 590 // if 'package:pkgA/libA.dart' was resolved, then there are no errors |
| 591 expect(filesErrors[testFile], isEmpty); | 591 expect(filesErrors[testFile], isEmpty); |
| 592 // packages file also was resolved | 592 // packages file also was resolved |
| 593 expect(filesErrors[pkgFile], isEmpty); | 593 expect(filesErrors[pkgFile], isEmpty); |
| 594 }); | 594 }); |
| 595 } | 595 } |
| 596 } | 596 } |
| OLD | NEW |