| 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 packageMapProvider.dependencies.add(pkgDependency); | 305 packageMapProvider.dependencies.add(pkgDependency); |
| 306 // Create project and wait for analysis | 306 // Create project and wait for analysis |
| 307 createProject(); | 307 createProject(); |
| 308 return waitForTasksFinished().then((_) { | 308 return waitForTasksFinished().then((_) { |
| 309 expect(filesErrors[testFile], isNotEmpty); | 309 expect(filesErrors[testFile], isNotEmpty); |
| 310 // Add the package to the package map and tickle the package dependency. | 310 // Add the package to the package map and tickle the package dependency. |
| 311 packageMapProvider.packageMap = { | 311 packageMapProvider.packageMap = { |
| 312 'pkgA': [resourceProvider.getResource('/packages/pkgA')] | 312 'pkgA': [resourceProvider.getResource('/packages/pkgA')] |
| 313 }; | 313 }; |
| 314 resourceProvider.modifyFile(pkgDependency, 'new contents'); | 314 resourceProvider.modifyFile(pkgDependency, 'new contents'); |
| 315 // Let the server time to notice the file has changed, then let | 315 // Give the server time to notice the file has changed, then let |
| 316 // analysis omplete. There should now be no error. | 316 // analysis complete. There should now be no error. |
| 317 return pumpEventQueue().then((_) => waitForTasksFinished()).then((_) { | 317 return pumpEventQueue().then((_) => waitForTasksFinished()).then((_) { |
| 318 expect(filesErrors[testFile], isEmpty); | 318 expect(filesErrors[testFile], isEmpty); |
| 319 }); | 319 }); |
| 320 }); | 320 }); |
| 321 } | 321 } |
| 322 | 322 |
| 323 test_setRoots_packages() { | 323 test_setRoots_packages() { |
| 324 // prepare package | 324 // prepare package |
| 325 String pkgFile = '/packages/pkgA/libA.dart'; | 325 String pkgFile = '/packages/pkgA/libA.dart'; |
| 326 resourceProvider.newFile(pkgFile, ''' | 326 resourceProvider.newFile(pkgFile, ''' |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 test_beforeAnalysis() async { | 697 test_beforeAnalysis() async { |
| 698 addTestFile('int V = 42;'); | 698 addTestFile('int V = 42;'); |
| 699 createProject(); | 699 createProject(); |
| 700 // subscribe | 700 // subscribe |
| 701 addAnalysisSubscription(AnalysisService.HIGHLIGHTS, testFile); | 701 addAnalysisSubscription(AnalysisService.HIGHLIGHTS, testFile); |
| 702 // wait for analysis | 702 // wait for analysis |
| 703 await waitForTasksFinished(); | 703 await waitForTasksFinished(); |
| 704 expect(filesHighlights[testFile], isNotEmpty); | 704 expect(filesHighlights[testFile], isNotEmpty); |
| 705 } | 705 } |
| 706 } | 706 } |
| OLD | NEW |