OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 analyzer.test.generated.test.generated.source_factory; | 5 library analyzer.test.generated.test.generated.source_factory; |
6 | 6 |
7 import 'dart:convert'; | 7 import 'dart:convert'; |
8 | 8 |
9 import 'package:analyzer/file_system/file_system.dart'; | 9 import 'package:analyzer/file_system/file_system.dart'; |
10 import 'package:analyzer/file_system/memory_file_system.dart'; | 10 import 'package:analyzer/file_system/memory_file_system.dart'; |
11 import 'package:analyzer/source/package_map_resolver.dart'; | 11 import 'package:analyzer/source/package_map_resolver.dart'; |
12 import 'package:analyzer/src/generated/engine.dart' show AnalysisEngine, Logger; | 12 import 'package:analyzer/src/generated/engine.dart' show AnalysisEngine, Logger; |
13 import 'package:analyzer/src/generated/java_core.dart'; | 13 import 'package:analyzer/src/generated/java_core.dart'; |
14 import 'package:analyzer/src/generated/java_engine_io.dart'; | 14 import 'package:analyzer/src/generated/java_engine_io.dart'; |
15 import 'package:analyzer/src/generated/source.dart'; | 15 import 'package:analyzer/src/generated/source.dart'; |
16 import 'package:analyzer/src/generated/source_io.dart'; | 16 import 'package:analyzer/src/generated/source_io.dart'; |
17 import 'package:analyzer/src/generated/utilities_dart.dart' as utils; | 17 import 'package:analyzer/src/generated/utilities_dart.dart' as utils; |
18 import 'package:analyzer/src/source/source_resource.dart'; | 18 import 'package:analyzer/src/source/source_resource.dart'; |
19 import 'package:package_config/packages.dart'; | 19 import 'package:package_config/packages.dart'; |
20 import 'package:package_config/packages_file.dart' as pkgfile show parse; | 20 import 'package:package_config/packages_file.dart' as pkgfile show parse; |
21 import 'package:package_config/src/packages_impl.dart'; | 21 import 'package:package_config/src/packages_impl.dart'; |
22 import 'package:path/path.dart'; | 22 import 'package:path/path.dart'; |
| 23 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
23 import 'package:unittest/unittest.dart'; | 24 import 'package:unittest/unittest.dart'; |
24 | 25 |
25 import '../reflective_tests.dart'; | |
26 import '../utils.dart'; | 26 import '../utils.dart'; |
27 import 'test_support.dart'; | 27 import 'test_support.dart'; |
28 | 28 |
29 main() { | 29 main() { |
30 initializeTestEnvironment(); | 30 initializeTestEnvironment(); |
31 runReflectiveTests(SourceFactoryTest); | 31 defineReflectiveTests(SourceFactoryTest); |
32 runPackageMapTests(); | 32 runPackageMapTests(); |
33 } | 33 } |
34 | 34 |
35 Source createSource({String path, String uri}) => | 35 Source createSource({String path, String uri}) => |
36 //TODO(pquitslund): find some way to pass an actual URI into source creation | 36 //TODO(pquitslund): find some way to pass an actual URI into source creation |
37 new MemoryResourceProvider() | 37 new MemoryResourceProvider() |
38 .getFile(path) | 38 .getFile(path) |
39 .createSource(uri != null ? Uri.parse(uri) : null); | 39 .createSource(uri != null ? Uri.parse(uri) : null); |
40 | 40 |
41 void runPackageMapTests() { | 41 void runPackageMapTests() { |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 UriResolver_SourceFactoryTest_test_fromEncoding_valid(this.encoding); | 361 UriResolver_SourceFactoryTest_test_fromEncoding_valid(this.encoding); |
362 | 362 |
363 @override | 363 @override |
364 Source resolveAbsolute(Uri uri, [Uri actualUri]) { | 364 Source resolveAbsolute(Uri uri, [Uri actualUri]) { |
365 if (uri.toString() == encoding) { | 365 if (uri.toString() == encoding) { |
366 return new TestSource(); | 366 return new TestSource(); |
367 } | 367 } |
368 return null; | 368 return null; |
369 } | 369 } |
370 } | 370 } |
OLD | NEW |