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

Unified Diff: tests/utils/dummy_compiler_test.dart

Issue 2976313002: Delete old tests that aren't used and/or useful any more. (Closed)
Patch Set: Resurrect dummy_compiler_test and recursive_import_test. 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: tests/utils/dummy_compiler_test.dart
diff --git a/tests/utils/dummy_compiler_test.dart b/tests/utils/dummy_compiler_test.dart
deleted file mode 100644
index 1252af5e43fe58805b85521da9f107aeefc2a5ec..0000000000000000000000000000000000000000
--- a/tests/utils/dummy_compiler_test.dart
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// Smoke test of the dart2js compiler API.
-library dummy_compiler;
-
-import 'dart:async';
-import "package:async_helper/async_helper.dart";
-
-import 'package:compiler/compiler.dart';
-
-import '../compiler/dart2js/mock_libraries.dart';
-
-String libProvider(Uri uri) {
- if (uri.path.endsWith(".platform")) {
- return DEFAULT_PLATFORM_CONFIG;
- }
- if (uri.path.endsWith("/core.dart")) {
- return buildLibrarySource(DEFAULT_CORE_LIBRARY);
- } else if (uri.path.endsWith('core_patch.dart')) {
- return DEFAULT_PATCH_CORE_SOURCE;
- } else if (uri.path.endsWith('internal.dart')) {
- return buildLibrarySource(DEFAULT_INTERNAL_LIBRARY);
- } else if (uri.path.endsWith('interceptors.dart')) {
- return buildLibrarySource(DEFAULT_INTERCEPTORS_LIBRARY);
- } else if (uri.path.endsWith('js_helper.dart')) {
- return buildLibrarySource(DEFAULT_JS_HELPER_LIBRARY);
- } else if (uri.path.endsWith('isolate_helper.dart')) {
- return buildLibrarySource(DEFAULT_ISOLATE_HELPER_LIBRARY);
- } else if (uri.path.endsWith('/async.dart')) {
- return buildLibrarySource(DEFAULT_ASYNC_LIBRARY);
- } else {
- return "library lib${uri.path.replaceAll('/', '.')};";
- }
-}
-
-Future<String> provider(Uri uri) {
- String source;
- if (uri.scheme == "main") {
- source = "main() {}";
- } else if (uri.scheme == "lib") {
- source = libProvider(uri);
- } else {
- throw "unexpected URI $uri";
- }
- return new Future.value(source);
-}
-
-void handler(Uri uri, int begin, int end, String message, Diagnostic kind) {
- if (uri == null) {
- print('$kind: $message');
- } else {
- print('$uri:$begin:$end: $kind: $message');
- }
-}
-
-main() {
- asyncStart();
- Future<CompilationResult> result = compile(
- new Uri(scheme: 'main'),
- new Uri(scheme: 'lib', path: '/'),
- new Uri(scheme: 'package', path: '/'),
- provider,
- handler);
- result.then((CompilationResult result) {
- if (!result.isSuccess) {
- throw 'Compilation failed';
- }
- }, onError: (e, s) {
- throw 'Compilation failed: $e\n$s';
- }).then(asyncSuccess);
-}

Powered by Google App Engine
This is Rietveld 408576698