Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

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

Issue 2979003002: support resolving .packages in FE (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
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/incremental/byte_store.dart'; 9 import 'package:front_end/src/incremental/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:test/test.dart'; 12 import 'package:test/test.dart';
12 import 'package:test_reflective_loader/test_reflective_loader.dart'; 13 import 'package:test_reflective_loader/test_reflective_loader.dart';
13 14
14 import 'mock_sdk.dart'; 15 import 'mock_sdk.dart';
15 16
16 main() { 17 main() {
17 defineReflectiveSuite(() { 18 defineReflectiveSuite(() {
18 defineReflectiveTests(FileSystemStateTest); 19 defineReflectiveTests(FileSystemStateTest);
19 }); 20 });
20 } 21 }
21 22
22 @reflectiveTest 23 @reflectiveTest
23 class FileSystemStateTest { 24 class FileSystemStateTest {
24 final byteStore = new MemoryByteStore(); 25 final byteStore = new MemoryByteStore();
25 final fileSystem = new MemoryFileSystem(Uri.parse('file:///')); 26 final fileSystem = new MemoryFileSystem(Uri.parse('file:///'));
26 final UriTranslatorImpl uriTranslator = new UriTranslatorImpl({}, {}, {}); 27 final UriTranslatorImpl uriTranslator =
28 new UriTranslatorImpl({}, {}, Packages.noPackages);
27 FileSystemState fsState; 29 FileSystemState fsState;
28 30
29 Uri _coreUri; 31 Uri _coreUri;
30 List<Uri> _newFileUris = <Uri>[]; 32 List<Uri> _newFileUris = <Uri>[];
31 33
32 void setUp() { 34 void setUp() {
33 Map<String, Uri> dartLibraries = createSdkFiles(fileSystem); 35 Map<String, Uri> dartLibraries = createSdkFiles(fileSystem);
34 uriTranslator.dartLibraries.addAll(dartLibraries); 36 uriTranslator.dartLibraries.addAll(dartLibraries);
35 _coreUri = Uri.parse('dart:core'); 37 _coreUri = Uri.parse('dart:core');
36 expect(_coreUri, isNotNull); 38 expect(_coreUri, isNotNull);
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 } 511 }
510 512
511 Uri _writeFileDirectives(String path, 513 Uri _writeFileDirectives(String path,
512 {List<String> imports: const [], List<String> exports: const []}) { 514 {List<String> imports: const [], List<String> exports: const []}) {
513 return writeFile(path, ''' 515 return writeFile(path, '''
514 ${imports.map((uri) => 'import "$uri";').join('\n')} 516 ${imports.map((uri) => 'import "$uri";').join('\n')}
515 ${exports.map((uri) => 'export "$uri";').join('\n')} 517 ${exports.map((uri) => 'export "$uri";').join('\n')}
516 '''); 518 ''');
517 } 519 }
518 } 520 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698