| 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/plugin/protocol/protocol.dart'; | 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 
| 10 import 'package:analysis_server/src/analysis_server.dart'; | 10 import 'package:analysis_server/src/analysis_server.dart'; | 
| 11 import 'package:analysis_server/src/constants.dart'; | 11 import 'package:analysis_server/src/constants.dart'; | 
| 12 import 'package:analysis_server/src/domain_analysis.dart'; | 12 import 'package:analysis_server/src/domain_analysis.dart'; | 
| 13 import 'package:analysis_server/src/plugin/server_plugin.dart'; | 13 import 'package:analysis_server/src/plugin/server_plugin.dart'; | 
|  | 14 import 'package:analyzer/file_system/file_system.dart'; | 
| 14 import 'package:analyzer/file_system/memory_file_system.dart'; | 15 import 'package:analyzer/file_system/memory_file_system.dart'; | 
| 15 import 'package:analyzer/instrumentation/instrumentation.dart'; | 16 import 'package:analyzer/instrumentation/instrumentation.dart'; | 
| 16 import 'package:analyzer/src/generated/sdk.dart'; | 17 import 'package:analyzer/src/generated/sdk.dart'; | 
| 17 import 'package:path/path.dart'; | 18 import 'package:path/path.dart'; | 
| 18 import 'package:plugin/manager.dart'; | 19 import 'package:plugin/manager.dart'; | 
| 19 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 20 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 
| 20 import 'package:unittest/unittest.dart'; | 21 import 'package:unittest/unittest.dart'; | 
| 21 | 22 | 
| 22 import 'analysis_abstract.dart'; | 23 import 'analysis_abstract.dart'; | 
| 23 import 'mock_sdk.dart'; | 24 import 'mock_sdk.dart'; | 
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 402 '''); | 403 '''); | 
| 403     String pkgDependency = posix.join(projectPath, 'package_dep'); | 404     String pkgDependency = posix.join(projectPath, 'package_dep'); | 
| 404     resourceProvider.newFile(pkgDependency, 'contents'); | 405     resourceProvider.newFile(pkgDependency, 'contents'); | 
| 405     packageMapProvider.dependencies.add(pkgDependency); | 406     packageMapProvider.dependencies.add(pkgDependency); | 
| 406     // Create project and wait for analysis | 407     // Create project and wait for analysis | 
| 407     createProject(); | 408     createProject(); | 
| 408     await waitForTasksFinished(); | 409     await waitForTasksFinished(); | 
| 409     expect(filesErrors[testFile], isNotEmpty); | 410     expect(filesErrors[testFile], isNotEmpty); | 
| 410     // Add the package to the package map and tickle the package dependency. | 411     // Add the package to the package map and tickle the package dependency. | 
| 411     packageMapProvider.packageMap = { | 412     packageMapProvider.packageMap = { | 
| 412       'pkgA': [resourceProvider.getResource('/packages/pkgA')] | 413       'pkgA': <Folder>[resourceProvider.getResource('/packages/pkgA')] | 
| 413     }; | 414     }; | 
| 414     resourceProvider.modifyFile(pkgDependency, 'new contents'); | 415     resourceProvider.modifyFile(pkgDependency, 'new contents'); | 
| 415     // Give the server time to notice the file has changed, then let | 416     // Give the server time to notice the file has changed, then let | 
| 416     // analysis complete. There should now be no error. | 417     // analysis complete. There should now be no error. | 
| 417     await pumpEventQueue(); | 418     await pumpEventQueue(); | 
| 418     await waitForTasksFinished(); | 419     await waitForTasksFinished(); | 
| 419     expect(filesErrors[testFile], isEmpty); | 420     expect(filesErrors[testFile], isEmpty); | 
| 420   } | 421   } | 
| 421 | 422 | 
| 422   test_setRoots_packages() { | 423   test_setRoots_packages() { | 
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 809   test_beforeAnalysis() async { | 810   test_beforeAnalysis() async { | 
| 810     addTestFile('int V = 42;'); | 811     addTestFile('int V = 42;'); | 
| 811     createProject(); | 812     createProject(); | 
| 812     // subscribe | 813     // subscribe | 
| 813     addAnalysisSubscription(AnalysisService.HIGHLIGHTS, testFile); | 814     addAnalysisSubscription(AnalysisService.HIGHLIGHTS, testFile); | 
| 814     // wait for analysis | 815     // wait for analysis | 
| 815     await waitForTasksFinished(); | 816     await waitForTasksFinished(); | 
| 816     expect(filesHighlights[testFile], isNotEmpty); | 817     expect(filesHighlights[testFile], isNotEmpty); | 
| 817   } | 818   } | 
| 818 } | 819 } | 
| OLD | NEW | 
|---|