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

Side by Side Diff: tests/compiler/dart2js/mirrors_test.dart

Issue 1235563003: Add interfaces for a new compiler API. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Rebased Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import "package:async_helper/async_helper.dart"; 6 import "package:async_helper/async_helper.dart";
7 import 'package:compiler/src/mirrors/source_mirrors.dart'; 7 import 'package:compiler/src/mirrors/source_mirrors.dart';
8 import 'package:compiler/src/mirrors/mirrors_util.dart'; 8 import 'package:compiler/src/mirrors/mirrors_util.dart';
9 import 'package:compiler/src/mirrors/analyze.dart'; 9 import 'package:compiler/src/mirrors/analyze.dart';
10 import 'package:compiler/src/filenames.dart' 10 import 'package:compiler/src/filenames.dart'
(...skipping 29 matching lines...) Expand all
40 } 40 }
41 return null; 41 return null;
42 } 42 }
43 43
44 main() { 44 main() {
45 Uri scriptUri = currentDirectory.resolveUri(Platform.script); 45 Uri scriptUri = currentDirectory.resolveUri(Platform.script);
46 Uri packageRoot = scriptUri.resolve('./packages/'); 46 Uri packageRoot = scriptUri.resolve('./packages/');
47 Uri libUri = scriptUri.resolve('../../../sdk/'); 47 Uri libUri = scriptUri.resolve('../../../sdk/');
48 Uri inputUri = scriptUri.resolve('mirrors_helper.dart'); 48 Uri inputUri = scriptUri.resolve('mirrors_helper.dart');
49 var provider = new CompilerSourceFileProvider(); 49 var provider = new CompilerSourceFileProvider();
50 var diagnosticHandler = 50 var diagnosticHandler = new FormattingDiagnosticHandler(provider);
51 new FormattingDiagnosticHandler(provider).diagnosticHandler;
52 asyncStart(); 51 asyncStart();
53 var result = analyze([inputUri], libUri, packageRoot, 52 var result = analyze([inputUri], libUri, packageRoot,
54 provider.readStringFromUri, diagnosticHandler, 53 provider.readStringFromUri, diagnosticHandler,
55 <String>['--preserve-comments']); 54 <String>['--preserve-comments']);
56 result.then((MirrorSystem mirrors) { 55 result.then((MirrorSystem mirrors) {
57 test(mirrors); 56 test(mirrors);
58 }).then(asyncSuccess); 57 }).then(asyncSuccess);
59 } 58 }
60 59
61 void test(MirrorSystem mirrors) { 60 void test(MirrorSystem mirrors) {
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 Expect.isTrue(privateFactoryConstructor.isPrivate); 986 Expect.isTrue(privateFactoryConstructor.isPrivate);
988 Expect.isFalse(privateFactoryConstructor.isConstConstructor); 987 Expect.isFalse(privateFactoryConstructor.isConstConstructor);
989 Expect.isFalse(privateFactoryConstructor.isRedirectingConstructor); 988 Expect.isFalse(privateFactoryConstructor.isRedirectingConstructor);
990 Expect.isFalse(privateFactoryConstructor.isGenerativeConstructor); 989 Expect.isFalse(privateFactoryConstructor.isGenerativeConstructor);
991 Expect.isTrue(privateFactoryConstructor.isFactoryConstructor); 990 Expect.isTrue(privateFactoryConstructor.isFactoryConstructor);
992 991
993 var metadata = privateClass.metadata; 992 var metadata = privateClass.metadata;
994 Expect.isNotNull(metadata); 993 Expect.isNotNull(metadata);
995 Expect.equals(0, metadata.length); 994 Expect.equals(0, metadata.length);
996 } 995 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/mirror_tree_shaking_test.dart ('k') | tests/compiler/dart2js/mirrors_used_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698