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

Side by Side Diff: tests/compiler/dart2js/backend_dart/test_helper.dart

Issue 824103005: Revert "Remove Compiler.assembledCode." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library dart_backend.test_helper; 5 library dart_backend.test_helper;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'package:async_helper/async_helper.dart'; 8 import 'package:async_helper/async_helper.dart';
9 import 'package:compiler/compiler.dart' as api;
10 import 'package:compiler/src/dart2jslib.dart'; 9 import 'package:compiler/src/dart2jslib.dart';
11 import '../../../../pkg/analyzer2dart/test/test_helper.dart'; 10 import '../../../../pkg/analyzer2dart/test/test_helper.dart';
12 import '../compiler_helper.dart'; 11 import '../compiler_helper.dart';
13 12
14 /// Compiles the given dart code (which must include a 'main' function) and 13 /// Compiles the given dart code (which must include a 'main' function) and
15 /// returns the compiler. 14 /// returns the compiler.
16 Future<Compiler> compilerFor(String code, 15 Future<Compiler> compilerFor(String code) {
17 {api.CompilerOutputProvider outputProvider}) {
18 MockCompiler compiler = new MockCompiler.internal( 16 MockCompiler compiler = new MockCompiler.internal(
19 emitJavaScript: false, 17 emitJavaScript: false,
20 enableMinification: false, 18 enableMinification: false);
21 outputProvider: outputProvider);
22 compiler.diagnosticHandler = createHandler(compiler, code); 19 compiler.diagnosticHandler = createHandler(compiler, code);
23 return compiler.init().then((_) { 20 return compiler.init().then((_) {
24 compiler.parseScript(code); 21 compiler.parseScript(code);
25 22
26 Element element = compiler.mainApp.find('main'); 23 Element element = compiler.mainApp.find('main');
27 if (element == null) return null; 24 if (element == null) return null;
28 25
29 compiler.mainFunction = element; 26 compiler.mainFunction = element;
30 compiler.phase = Compiler.PHASE_RESOLVING; 27 compiler.phase = Compiler.PHASE_RESOLVING;
31 compiler.backend.enqueueHelpers(compiler.enqueuer.resolution, 28 compiler.backend.enqueueHelpers(compiler.enqueuer.resolution,
32 compiler.globalDependencies); 29 compiler.globalDependencies);
33 compiler.processQueue(compiler.enqueuer.resolution, element); 30 compiler.processQueue(compiler.enqueuer.resolution, element);
34 compiler.world.populate(); 31 compiler.world.populate();
35 compiler.backend.onResolutionComplete(); 32 compiler.backend.onResolutionComplete();
36 33
37 compiler.irBuilder.buildNodes(); 34 compiler.irBuilder.buildNodes();
38 35
39 return compiler; 36 return compiler;
40 }); 37 });
41 } 38 }
42 39
43 /// Test group using async_helper. 40 /// Test group using async_helper.
44 asyncTester(Group group, RunTest runTest) { 41 asyncTester(Group group, RunTest runTest) {
45 asyncTest(() => Future.forEach(group.results, runTest)); 42 asyncTest(() => Future.forEach(group.results, runTest));
46 } 43 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/backend_dart/end2end_test.dart ('k') | tests/compiler/dart2js/compiler_alt.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698