Chromium Code Reviews

Side by Side Diff: pkg/front_end/test/src/incremental/file_state_test.dart

Issue 3007503002: Load extraRequiredLibraries from the target passed in the options (Closed)
Patch Set: Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « pkg/front_end/lib/src/incremental/kernel_driver.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:front_end/memory_file_system.dart'; 7 import 'package:front_end/memory_file_system.dart';
8 import 'package:front_end/src/fasta/uri_translator_impl.dart'; 8 import 'package:front_end/src/fasta/uri_translator_impl.dart';
9 import 'package:front_end/src/byte_store/byte_store.dart'; 9 import 'package:front_end/src/byte_store/byte_store.dart';
10 import 'package:front_end/src/incremental/file_state.dart'; 10 import 'package:front_end/src/incremental/file_state.dart';
11 import 'package:package_config/packages.dart'; 11 import 'package:package_config/packages.dart';
12 import 'package:test/test.dart'; 12 import 'package:test/test.dart';
13 import 'package:test_reflective_loader/test_reflective_loader.dart'; 13 import 'package:test_reflective_loader/test_reflective_loader.dart';
14 import 'package:kernel/target/targets.dart';
14 15
15 import 'mock_sdk.dart'; 16 import 'mock_sdk.dart';
16 17
17 main() { 18 main() {
18 defineReflectiveSuite(() { 19 defineReflectiveSuite(() {
19 defineReflectiveTests(FileSystemStateTest); 20 defineReflectiveTests(FileSystemStateTest);
20 }); 21 });
21 } 22 }
22 23
23 @reflectiveTest 24 @reflectiveTest
24 class FileSystemStateTest { 25 class FileSystemStateTest {
25 final byteStore = new MemoryByteStore(); 26 final byteStore = new MemoryByteStore();
26 final fileSystem = new MemoryFileSystem(Uri.parse('file:///')); 27 final fileSystem = new MemoryFileSystem(Uri.parse('file:///'));
27 FileSystemState fsState; 28 FileSystemState fsState;
28 29
29 Uri _coreUri; 30 Uri _coreUri;
30 List<Uri> _newFileUris = <Uri>[]; 31 List<Uri> _newFileUris = <Uri>[];
31 32
32 void setUp() { 33 void setUp() {
33 var uriTranslator = 34 var uriTranslator =
34 new UriTranslatorImpl(createSdkFiles(fileSystem), Packages.noPackages); 35 new UriTranslatorImpl(createSdkFiles(fileSystem), Packages.noPackages);
35 _coreUri = Uri.parse('dart:core'); 36 _coreUri = Uri.parse('dart:core');
36 expect(_coreUri, isNotNull); 37 expect(_coreUri, isNotNull);
37 fsState = new FileSystemState(byteStore, fileSystem, uriTranslator, <int>[], 38 fsState = new FileSystemState(byteStore, fileSystem,
38 (uri) { 39 new NoneTarget(new TargetFlags()), uriTranslator, <int>[], (uri) {
39 _newFileUris.add(uri); 40 _newFileUris.add(uri);
40 return new Future.value(); 41 return new Future.value();
41 }); 42 });
42 } 43 }
43 44
44 test_apiSignature() async { 45 test_apiSignature() async {
45 var path = '/a.dart'; 46 var path = '/a.dart';
46 var uri = writeFile(path, ''); 47 var uri = writeFile(path, '');
47 FileState file = await fsState.getFile(uri); 48 FileState file = await fsState.getFile(uri);
48 49
(...skipping 460 matching lines...)
509 } 510 }
510 511
511 Uri _writeFileDirectives(String path, 512 Uri _writeFileDirectives(String path,
512 {List<String> imports: const [], List<String> exports: const []}) { 513 {List<String> imports: const [], List<String> exports: const []}) {
513 return writeFile(path, ''' 514 return writeFile(path, '''
514 ${imports.map((uri) => 'import "$uri";').join('\n')} 515 ${imports.map((uri) => 'import "$uri";').join('\n')}
515 ${exports.map((uri) => 'export "$uri";').join('\n')} 516 ${exports.map((uri) => 'export "$uri";').join('\n')}
516 '''); 517 ''');
517 } 518 }
518 } 519 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/incremental/kernel_driver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine