| OLD | NEW |
| 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:analyzer/src/summary/format.dart'; | 7 import 'package:analyzer/src/summary/format.dart'; |
| 8 import 'package:front_end/compiler_options.dart'; | 8 import 'package:front_end/compiler_options.dart'; |
| 9 import 'package:front_end/memory_file_system.dart'; | 9 import 'package:front_end/memory_file_system.dart'; |
| 10 import 'package:front_end/src/base/processed_options.dart'; | 10 import 'package:front_end/src/base/processed_options.dart'; |
| 11 import 'package:path/path.dart' as pathos; |
| 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 main() { | 15 main() { |
| 15 defineReflectiveSuite(() { | 16 defineReflectiveSuite(() { |
| 16 defineReflectiveTests(ProcessedOptionsTest); | 17 defineReflectiveTests(ProcessedOptionsTest); |
| 17 }); | 18 }); |
| 18 } | 19 } |
| 19 | 20 |
| 20 @reflectiveTest | 21 @reflectiveTest |
| 21 class ProcessedOptionsTest { | 22 class ProcessedOptionsTest { |
| 22 final fileSystem = new MemoryFileSystem(Uri.parse('file:///')); | 23 final fileSystem = new MemoryFileSystem(pathos.posix, Uri.parse('file:///')); |
| 23 | 24 |
| 24 PackageBundleBuilder _mockSdkSummary; | 25 PackageBundleBuilder _mockSdkSummary; |
| 25 | 26 |
| 26 PackageBundleBuilder get mockSdkSummary => _mockSdkSummary ??= | 27 PackageBundleBuilder get mockSdkSummary => _mockSdkSummary ??= |
| 27 new PackageBundleBuilder(apiSignature: 'mock summary signature'); | 28 new PackageBundleBuilder(apiSignature: 'mock summary signature'); |
| 28 | 29 |
| 29 Future<Null> checkMockSummary(CompilerOptions raw) async { | 30 Future<Null> checkMockSummary(CompilerOptions raw) async { |
| 30 var processed = new ProcessedOptions(raw); | 31 var processed = new ProcessedOptions(raw); |
| 31 var sdkSummary = await processed.getSdkSummary(); | 32 var sdkSummary = await processed.getSdkSummary(); |
| 32 expect(sdkSummary.apiSignature, mockSdkSummary.apiSignature); | 33 expect(sdkSummary.apiSignature, mockSdkSummary.apiSignature); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 ..packagesFileUri = new Uri(); | 127 ..packagesFileUri = new Uri(); |
| 127 var processed = new ProcessedOptions(raw); | 128 var processed = new ProcessedOptions(raw); |
| 128 var uriResolver = await processed.getUriResolver(); | 129 var uriResolver = await processed.getUriResolver(); |
| 129 expect(uriResolver.packages, isEmpty); | 130 expect(uriResolver.packages, isEmpty); |
| 130 } | 131 } |
| 131 | 132 |
| 132 void writeMockSummaryTo(Uri uri) { | 133 void writeMockSummaryTo(Uri uri) { |
| 133 fileSystem.entityForUri(uri).writeAsBytesSync(mockSdkSummary.toBuffer()); | 134 fileSystem.entityForUri(uri).writeAsBytesSync(mockSdkSummary.toBuffer()); |
| 134 } | 135 } |
| 135 } | 136 } |
| OLD | NEW |