| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'package:analyzer/file_system/file_system.dart'; | 5 import 'package:analyzer/file_system/file_system.dart'; |
| 6 import 'package:analyzer/source/package_map_resolver.dart'; | 6 import 'package:analyzer/source/package_map_resolver.dart'; |
| 7 import 'package:analyzer/src/generated/source.dart'; | 7 import 'package:analyzer/src/generated/source.dart'; |
| 8 import 'package:analyzer/src/summary/format.dart'; | 8 import 'package:analyzer/src/summary/format.dart'; |
| 9 import 'package:analyzer/src/summary/idl.dart'; | 9 import 'package:analyzer/src/summary/idl.dart'; |
| 10 import 'package:analyzer/src/summary/pub_summary.dart'; | 10 import 'package:analyzer/src/summary/pub_summary.dart'; |
| 11 import 'package:analyzer/src/summary/summarize_elements.dart'; | 11 import 'package:analyzer/src/summary/summarize_elements.dart'; |
| 12 import 'package:analyzer/src/util/fast_uri.dart'; | |
| 13 import 'package:path/path.dart' as pathos; | 12 import 'package:path/path.dart' as pathos; |
| 14 import 'package:test/test.dart'; | 13 import 'package:test/test.dart'; |
| 15 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 14 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 16 | 15 |
| 17 import '../context/abstract_context.dart'; | 16 import '../context/abstract_context.dart'; |
| 18 import '../context/mock_sdk.dart'; | 17 import '../context/mock_sdk.dart'; |
| 19 | 18 |
| 20 main() { | 19 main() { |
| 21 defineReflectiveSuite(() { | 20 defineReflectiveSuite(() { |
| 22 defineReflectiveTests(PubSummaryManagerTest); | 21 defineReflectiveTests(PubSummaryManagerTest); |
| (...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1097 String aaaPath = '/Users/user/projects/aaa'; | 1096 String aaaPath = '/Users/user/projects/aaa'; |
| 1098 // Create package files. | 1097 // Create package files. |
| 1099 { | 1098 { |
| 1100 File file = newFile( | 1099 File file = newFile( |
| 1101 '$aaaPath/lib/a.dart', | 1100 '$aaaPath/lib/a.dart', |
| 1102 ''' | 1101 ''' |
| 1103 class A {} | 1102 class A {} |
| 1104 '''); | 1103 '''); |
| 1105 PackageBundleAssembler assembler = new PackageBundleAssembler() | 1104 PackageBundleAssembler assembler = new PackageBundleAssembler() |
| 1106 ..addUnlinkedUnit( | 1105 ..addUnlinkedUnit( |
| 1107 file.createSource(FastUri.parse('package:aaa/a.dart')), | 1106 file.createSource(Uri.parse('package:aaa/a.dart')), |
| 1108 new UnlinkedUnitBuilder()); | 1107 new UnlinkedUnitBuilder()); |
| 1109 resourceProvider.newFileWithBytes( | 1108 resourceProvider.newFileWithBytes( |
| 1110 resourceProvider | 1109 resourceProvider |
| 1111 .convertPath('$aaaPath/${PubSummaryManager.UNLINKED_SPEC_NAME}'), | 1110 .convertPath('$aaaPath/${PubSummaryManager.UNLINKED_SPEC_NAME}'), |
| 1112 assembler.assemble().toBuffer()); | 1111 assembler.assemble().toBuffer()); |
| 1113 } | 1112 } |
| 1114 newFile( | 1113 newFile( |
| 1115 '$CACHE/bbb/lib/b.dart', | 1114 '$CACHE/bbb/lib/b.dart', |
| 1116 ''' | 1115 ''' |
| 1117 class B {} | 1116 class B {} |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1377 } | 1376 } |
| 1378 } | 1377 } |
| 1379 | 1378 |
| 1380 static PackageBundle _getBundleByPackageName( | 1379 static PackageBundle _getBundleByPackageName( |
| 1381 Map<PubPackage, PackageBundle> bundles, String name) { | 1380 Map<PubPackage, PackageBundle> bundles, String name) { |
| 1382 PubPackage package = | 1381 PubPackage package = |
| 1383 bundles.keys.singleWhere((package) => package.name == name); | 1382 bundles.keys.singleWhere((package) => package.name == name); |
| 1384 return bundles[package]; | 1383 return bundles[package]; |
| 1385 } | 1384 } |
| 1386 } | 1385 } |
| OLD | NEW |