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

Unified Diff: pkg/front_end/test/src/base/processed_options_test.dart

Issue 2979463002: Revert "Tweak public APIs and use them in patch_sdk, dart2js, and kernel-service." (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 side-by-side diff with in-line comments
Download patch
Index: pkg/front_end/test/src/base/processed_options_test.dart
diff --git a/pkg/front_end/test/src/base/processed_options_test.dart b/pkg/front_end/test/src/base/processed_options_test.dart
index ca17096c2712207fea948b260d0887dda3e2d6dd..365c5f2ce5d38e4f63bc1abeee6fd284a79f5ca3 100644
--- a/pkg/front_end/test/src/base/processed_options_test.dart
+++ b/pkg/front_end/test/src/base/processed_options_test.dart
@@ -9,7 +9,7 @@ import 'package:front_end/memory_file_system.dart';
import 'package:front_end/src/base/processed_options.dart';
import 'package:front_end/src/fasta/fasta.dart' show ByteSink;
import 'package:kernel/binary/ast_to_binary.dart' show BinaryPrinter;
-import 'package:kernel/kernel.dart' show Program, Library, CanonicalName;
+import 'package:kernel/kernel.dart' show Program, Library;
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
@@ -37,22 +37,6 @@ class ProcessedOptionsTest {
}
}
- test_sdk_summary_inferred() {
- // The sdk-summary is inferred by default form sdk-root, when compile-sdk is
- // false
- var raw = new CompilerOptions()
- ..sdkRoot = Uri.parse('file:///sdk/dir/')
- ..compileSdk = false;
- expect(new ProcessedOptions(raw).sdkSummary,
- Uri.parse('file:///sdk/dir/outline.dill'));
-
- // But it is left null when compile-sdk is true
- raw = new CompilerOptions()
- ..sdkRoot = Uri.parse('file:///sdk/dir/')
- ..compileSdk = true;
- expect(new ProcessedOptions(raw).sdkSummary, null);
- }
-
test_fileSystem_noBazelRoots() {
// When no bazel roots are specified, the filesystem should be passed
// through unmodified.
@@ -77,7 +61,7 @@ class ProcessedOptionsTest {
Future<Null> checkMockSummary(CompilerOptions raw) async {
var processed = new ProcessedOptions(raw);
- var sdkSummary = await processed.loadSdkSummary(new CanonicalName.root());
+ var sdkSummary = await processed.sdkSummaryProgram;
expect(sdkSummary.libraries.single.importUri,
mockSummary.libraries.single.importUri);
}
@@ -129,97 +113,4 @@ class ProcessedOptionsTest {
var uriTranslator = await processed.getUriTranslator();
expect(uriTranslator.packages, isEmpty);
}
-
- test_validateOptions_root_exists() async {
- var sdkRoot = Uri.parse('file:///sdk/root/');
- fileSystem
- // Note: this test is a bit hackish because the memory file system
- // doesn't have the notion of directories.
- .entityForUri(sdkRoot)
- .writeAsStringSync('\n');
- fileSystem
- .entityForUri(sdkRoot.resolve('outline.dill'))
- .writeAsStringSync('\n');
-
- var errors = [];
- var raw = new CompilerOptions()
- ..sdkRoot = sdkRoot
- ..fileSystem = fileSystem
- ..onError = (e) => errors.add(e);
- var options = new ProcessedOptions(raw);
- var result = await options.validateOptions();
- // Note: we check this first so test failures show the cause directly.
- expect(errors, isEmpty);
- expect(result, isTrue);
- }
-
- test_validateOptions_root_doesnt_exists() async {
- var sdkRoot = Uri.parse('file:///sdk/root');
- var errors = [];
- var raw = new CompilerOptions()
- ..sdkRoot = sdkRoot
- ..fileSystem = fileSystem
- ..onError = (e) => errors.add(e);
- var options = new ProcessedOptions(raw);
- expect(await options.validateOptions(), isFalse);
- expect('${errors.first}', contains("SDK root directory not found"));
- }
-
- test_validateOptions_summary_exists() async {
- var sdkSummary = Uri.parse('file:///sdk/root/outline.dill');
- fileSystem.entityForUri(sdkSummary).writeAsStringSync('\n');
-
- var errors = [];
- var raw = new CompilerOptions()
- ..sdkSummary = sdkSummary
- ..fileSystem = fileSystem
- ..onError = (e) => errors.add(e);
- var options = new ProcessedOptions(raw);
- var result = await options.validateOptions();
- expect(errors, isEmpty);
- expect(result, isTrue);
- }
-
- test_validateOptions_summary_doesnt_exists() async {
- var sdkSummary = Uri.parse('file:///sdk/root/outline.dill');
- var errors = [];
- var raw = new CompilerOptions()
- ..sdkSummary = sdkSummary
- ..fileSystem = fileSystem
- ..onError = (e) => errors.add(e);
- var options = new ProcessedOptions(raw);
- expect(await options.validateOptions(), isFalse);
- expect('${errors.first}', contains("SDK summary not found"));
- }
-
- test_validateOptions_inferred_summary_exists() async {
- var sdkRoot = Uri.parse('file:///sdk/root/');
- var sdkSummary = Uri.parse('file:///sdk/root/outline.dill');
- fileSystem.entityForUri(sdkRoot).writeAsStringSync('\n');
- fileSystem.entityForUri(sdkSummary).writeAsStringSync('\n');
-
- var errors = [];
- var raw = new CompilerOptions()
- ..sdkRoot = sdkRoot
- ..fileSystem = fileSystem
- ..onError = (e) => errors.add(e);
- var options = new ProcessedOptions(raw);
- var result = await options.validateOptions();
- expect(errors, isEmpty);
- expect(result, isTrue);
- }
-
- test_validateOptions_inferred_summary_doesnt_exists() async {
- var sdkRoot = Uri.parse('file:///sdk/root/');
- var sdkSummary = Uri.parse('file:///sdk/root/outline.dill');
- fileSystem.entityForUri(sdkRoot).writeAsStringSync('\n');
- var errors = [];
- var raw = new CompilerOptions()
- ..sdkSummary = sdkSummary
- ..fileSystem = fileSystem
- ..onError = (e) => errors.add(e);
- var options = new ProcessedOptions(raw);
- expect(await options.validateOptions(), isFalse);
- expect('${errors.first}', contains("SDK summary not found"));
- }
}
« no previous file with comments | « pkg/front_end/test/kernel_generator_test.dart ('k') | pkg/front_end/test/src/incremental/hot_reload_e2e_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698