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

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

Issue 64793003: Update mirror tests for removed API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: . Created 7 years, 1 month 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
« no previous file with comments | « runtime/tests/vm/dart/mirrored_compilation_error_test.dart ('k') | tests/lib/lib.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 'dart:async'; 6 import 'dart:async';
7 import "package:async_helper/async_helper.dart"; 7 import "package:async_helper/async_helper.dart";
8 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' show 8 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' show
9 DualKind, 9 DualKind,
10 MessageKind; 10 MessageKind;
11 11
12 import 'message_kind_helper.dart'; 12 import 'message_kind_helper.dart';
13 13
14 import 'dart:mirrors'; 14 import 'dart:mirrors';
15 15
16 main() { 16 main() {
17 ClassMirror cls = reflectClass(MessageKind); 17 ClassMirror cls = reflectClass(MessageKind);
18 Map<String, MessageKind> kinds = <String, MessageKind>{}; 18 Map<String, MessageKind> kinds = <String, MessageKind>{};
19 cls.variables.forEach((Symbol name, VariableMirror variable) { 19 cls.declarations.forEach((Symbol name, DeclarationMirror declaration) {
20 if (declaration is! VariableMirror) return;
21 VariableMirror variable = declaration;
20 if (variable.isStatic) { 22 if (variable.isStatic) {
21 var value = cls.getField(name).reflectee; 23 var value = cls.getField(name).reflectee;
22 if (value is MessageKind) { 24 if (value is MessageKind) {
23 kinds[MirrorSystem.getName(name)] = value; 25 kinds[MirrorSystem.getName(name)] = value;
24 } else if (value is DualKind) { 26 } else if (value is DualKind) {
25 kinds['${MirrorSystem.getName(name)}.error'] = value.error; 27 kinds['${MirrorSystem.getName(name)}.error'] = value.error;
26 kinds['${MirrorSystem.getName(name)}.warning'] = value.warning; 28 kinds['${MirrorSystem.getName(name)}.warning'] = value.warning;
27 } else { 29 } else {
28 Expect.fail("Weird static field: '${MirrorSystem.getName(name)}'."); 30 Expect.fail("Weird static field: '${MirrorSystem.getName(name)}'.");
29 } 31 }
(...skipping 20 matching lines...) Expand all
50 Stopwatch sw = new Stopwatch()..start(); 52 Stopwatch sw = new Stopwatch()..start();
51 return check(kinds[name], cachedCompiler). 53 return check(kinds[name], cachedCompiler).
52 then((var compiler) { 54 then((var compiler) {
53 cachedCompiler = compiler; 55 cachedCompiler = compiler;
54 sw.stop(); 56 sw.stop();
55 print("Checked '$name' in ${sw.elapsedMilliseconds}ms."); 57 print("Checked '$name' in ${sw.elapsedMilliseconds}ms.");
56 }); 58 });
57 } 59 }
58 )); 60 ));
59 } 61 }
OLDNEW
« no previous file with comments | « runtime/tests/vm/dart/mirrored_compilation_error_test.dart ('k') | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698