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.context.directory.manager; | 5 library test.context.directory.manager; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analysis_server/src/context_manager.dart'; | 9 import 'package:analysis_server/src/context_manager.dart'; |
10 import 'package:analyzer/file_system/file_system.dart'; | 10 import 'package:analyzer/file_system/file_system.dart'; |
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1336 callbacks.assertContextFiles(subProject, [subFile]); | 1336 callbacks.assertContextFiles(subProject, [subFile]); |
1337 // delete the pubspec | 1337 // delete the pubspec |
1338 resourceProvider.deleteFile(subPubspec); | 1338 resourceProvider.deleteFile(subPubspec); |
1339 return pumpEventQueue().then((_) { | 1339 return pumpEventQueue().then((_) { |
1340 callbacks.assertContextPaths([root]); | 1340 callbacks.assertContextPaths([root]); |
1341 callbacks.assertContextFiles(root, [rootFile, subFile]); | 1341 callbacks.assertContextFiles(root, [rootFile, subFile]); |
1342 }); | 1342 }); |
1343 } | 1343 } |
1344 | 1344 |
1345 test_watch_deletePackagespec_fromSubFolder_withPubspec() { | 1345 test_watch_deletePackagespec_fromSubFolder_withPubspec() { |
1346 // prepare paths | 1346 // prepare paths: |
| 1347 // |
| 1348 // root |
| 1349 // root.dart |
| 1350 // sub |
| 1351 // aaa |
| 1352 // .packages |
| 1353 // pubspec.yaml |
| 1354 // bin |
| 1355 // a.dart |
| 1356 // |
1347 String root = '/root'; | 1357 String root = '/root'; |
1348 String rootFile = '$root/root.dart'; | 1358 String rootFile = '$root/root.dart'; |
1349 String subProject = '$root/sub/aaa'; | 1359 String subProject = '$root/sub/aaa'; |
1350 String subPackagespec = '$subProject/.packages'; | 1360 String subPackagespec = '$subProject/.packages'; |
1351 String subPubspec = '$subProject/pubspec.yaml'; | 1361 String subPubspec = '$subProject/pubspec.yaml'; |
1352 String subFile = '$subProject/bin/a.dart'; | 1362 String subFile = '$subProject/bin/a.dart'; |
1353 // create files | 1363 // create files |
1354 resourceProvider.newFile(subPackagespec, ''); | 1364 resourceProvider.newFile(subPackagespec, ''); |
1355 resourceProvider.newFile(subPubspec, 'pubspec'); | 1365 resourceProvider.newFile(subPubspec, 'pubspec'); |
1356 resourceProvider.newFile(rootFile, 'library root;'); | 1366 resourceProvider.newFile(rootFile, 'library root;'); |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1669 class TestUriResolver extends UriResolver { | 1679 class TestUriResolver extends UriResolver { |
1670 Map<Uri, Source> uriMap; | 1680 Map<Uri, Source> uriMap; |
1671 | 1681 |
1672 TestUriResolver(this.uriMap); | 1682 TestUriResolver(this.uriMap); |
1673 | 1683 |
1674 @override | 1684 @override |
1675 Source resolveAbsolute(Uri uri, [Uri actualUri]) { | 1685 Source resolveAbsolute(Uri uri, [Uri actualUri]) { |
1676 return uriMap[uri]; | 1686 return uriMap[uri]; |
1677 } | 1687 } |
1678 } | 1688 } |
OLD | NEW |