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

Unified Diff: tests/compiler/dart2js/library_env_test.dart

Issue 1573243004: Revert "Add support for 'dart.library.X' environment variables in dart2js." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « pkg/compiler/lib/src/apiimpl.dart ('k') | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/library_env_test.dart
diff --git a/tests/compiler/dart2js/library_env_test.dart b/tests/compiler/dart2js/library_env_test.dart
deleted file mode 100644
index 81567e981207abe691a40de2dd6627dd358af340..0000000000000000000000000000000000000000
--- a/tests/compiler/dart2js/library_env_test.dart
+++ /dev/null
@@ -1,130 +0,0 @@
-// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/// Check that 'dart:' libraries have their corresponding dart.library.X
-/// environment variable set.
-
-import "dart:io";
-
-import "dart:async";
-
-import "memory_source_file_helper.dart";
-
-import "package:async_helper/async_helper.dart";
-
-import 'package:expect/expect.dart' show
- Expect;
-
-import 'package:compiler/src/elements/elements.dart' show
- LibraryElement;
-
-import 'package:compiler/src/null_compiler_output.dart' show
- NullCompilerOutput;
-
-import 'package:compiler/compiler_new.dart' show
- CompilerInput,
- CompilerDiagnostics;
-
-import 'package:sdk_library_metadata/libraries.dart' show
- DART2JS_PLATFORM,
- LibraryInfo;
-
-const LibraryInfo mock1LibraryInfo = const LibraryInfo(
- "mock1.dart",
- category: "Client",
- documented: false,
- platforms: DART2JS_PLATFORM);
-
-const LibraryInfo mock2LibraryInfo = const LibraryInfo(
- "mock2.dart",
- category: "Server",
- documented: false,
- platforms: DART2JS_PLATFORM);
-
-const LibraryInfo mock3LibraryInfo = const LibraryInfo(
- "mock3.dart",
- category: "Shared",
- documented: false,
- platforms: DART2JS_PLATFORM);
-
-class DummyCompilerInput implements CompilerInput {
- const DummyCompilerInput();
-
- readFromUri(uri) {
- throw "should not be needed";
- }
-}
-
-class DummyCompilerDiagnostics implements CompilerDiagnostics {
- const DummyCompilerDiagnostics();
-
- report(code, uri, begin, end, text, kind) {
- throw "should not be needed";
- }
-}
-
-class CustomCompiler extends Compiler {
- CustomCompiler(
- options,
- environment)
- : super(
- const DummyCompilerInput(),
- const NullCompilerOutput(),
- const DummyCompilerDiagnostics(),
- Uri.base.resolve("sdk/"),
- null,
- options,
- environment);
-
- LibraryInfo lookupLibraryInfo(String name) {
- if (name == "mock.client") return mock1LibraryInfo;
- if (name == "mock.server") return mock2LibraryInfo;
- if (name == "mock.shared") return mock3LibraryInfo;
- return super.lookupLibraryInfo(name);
- }
-}
-
-main() {
- Compiler compiler = new CustomCompiler(
- [],
- {});
-
- // Core libraries are always present.
- Expect.equals("true", compiler.fromEnvironment("dart.library.collection"));
- // Non-existing entries in the environment return 'null'.
- Expect.isNull(compiler.fromEnvironment("not in env"));
- // Check for client libraries (default if there are no flags to the compiler).
- Expect.equals("true", compiler.fromEnvironment("dart.library.mock.client"));
- Expect.equals("true", compiler.fromEnvironment("dart.library.html"));
- // Check for shared libraries..
- Expect.equals("true", compiler.fromEnvironment("dart.library.mock.shared"));
- // Check server libraries are not present.
- Expect.equals(null, compiler.fromEnvironment("dart.library.mock.server"));
- Expect.equals(null, compiler.fromEnvironment("dart.library.io"));
-
- compiler = new CustomCompiler(
- ['--categories=Server'],
- {});
-
- // Core libraries are always present.
- Expect.equals("true", compiler.fromEnvironment("dart.library.collection"));
- // Non-existing entries in the environment return 'null'.
- Expect.isNull(compiler.fromEnvironment("not in env"));
- // Check client libraries are not present.
- Expect.equals(null, compiler.fromEnvironment("dart.library.mock.client"));
- Expect.equals(null, compiler.fromEnvironment("dart.library.html"));
- // Check for shared libraries..
- Expect.equals("true", compiler.fromEnvironment("dart.library.mock.shared"));
- // Check for server libraries.
- Expect.equals("true", compiler.fromEnvironment("dart.library.mock.server"));
- Expect.equals("true", compiler.fromEnvironment("dart.library.io"));
-
- // Check that user-defined env-variables win.
- compiler = new CustomCompiler(
- [],
- {'dart.library.collection': "false",
- 'dart.library.mock.client': "foo"});
- Expect.equals("false", compiler.fromEnvironment("dart.library.collection"));
- Expect.equals("foo", compiler.fromEnvironment("dart.library.mock.client"));
-}
« no previous file with comments | « pkg/compiler/lib/src/apiimpl.dart ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698