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

Side by Side Diff: pkg/front_end/test/src/base/processed_options_test.dart

Issue 2850533004: Revert "Extend file-system abstraction with a couple methods, remove context." (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « pkg/front_end/test/physical_file_system_test.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: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
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 }
OLDNEW
« no previous file with comments | « pkg/front_end/test/physical_file_system_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698