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

Unified Diff: tests/compiler/dart2js/js_model/model_test.dart

Issue 2929643002: Introduce JsStrategy skeleton (Closed)
Patch Set: Updated cf. comments Created 3 years, 6 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/world.dart ('k') | tests/compiler/dart2js/kernel/compiler_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/js_model/model_test.dart
diff --git a/tests/compiler/dart2js/js_model/model_test.dart b/tests/compiler/dart2js/js_model/model_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..b561418c11a728831d36a39f84ead95f51157996
--- /dev/null
+++ b/tests/compiler/dart2js/js_model/model_test.dart
@@ -0,0 +1,49 @@
+// Copyright (c) 2017, 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.
+
+import 'dart:async';
+import 'package:async_helper/async_helper.dart';
+import 'package:compiler/src/commandline_options.dart';
+import 'package:compiler/src/common.dart';
+import 'package:compiler/src/compiler.dart';
+import 'package:compiler/src/js_model/js_strategy.dart';
+import 'package:expect/expect.dart';
+import '../kernel/compiler_helper.dart';
+import '../serialization/helper.dart';
+
+const Map<String, String> SOURCE = const <String, String>{
+ 'main.dart': r'''
+main() {}
+'''
+};
+
+main(List<String> args) {
+ asyncTest(() async {
+ await mainInternal(args);
+ });
+}
+
+Future mainInternal(List<String> args,
+ {bool skipWarnings: false, bool skipErrors: false}) async {
+ Arguments arguments = new Arguments.from(args);
+ Uri entryPoint;
+ Map<String, String> memorySourceFiles;
+ if (arguments.uri != null) {
+ entryPoint = arguments.uri;
+ memorySourceFiles = const <String, String>{};
+ } else {
+ entryPoint = Uri.parse('memory:main.dart');
+ memorySourceFiles = SOURCE;
+ }
+
+ enableDebugMode();
+
+ Compiler compiler1 = await compileWithDill(entryPoint, memorySourceFiles, [
+ Flags.disableInlining,
+ Flags.disableTypeInference
+ ], beforeRun: (Compiler compiler) {
+ compiler.backendStrategy = new JsBackendStrategy(compiler);
+ });
+ Expect.isFalse(compiler1.compilationFailed);
+}
« no previous file with comments | « pkg/compiler/lib/src/world.dart ('k') | tests/compiler/dart2js/kernel/compiler_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698