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

Side by Side Diff: tests/lib/mirrors/regress_19731_test.dart

Issue 2727323002: Add @MirrorsUsed annotations to speed up tests. (Closed)
Patch Set: Minor fixes. Created 3 years, 9 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
« no previous file with comments | « tests/lib/mirrors/regress_16321_test.dart ('k') | tests/lib/mirrors/regress_26187_test.dart » ('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) 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 @metadata 5 @metadata
6 library regress_19731; 6 library regress_19731;
7 7
8 @MirrorsUsed(targets: "regress_19731")
8 import 'dart:mirrors'; 9 import 'dart:mirrors';
9 import 'package:expect/expect.dart'; 10 import 'package:expect/expect.dart';
10 11
11 @metadata 12 @metadata
12 const metadata = const Object(); 13 const metadata = const Object();
13 14
14 class OneField { 15 class OneField {
15 @metadata 16 @metadata
16 var onlyClassField; 17 var onlyClassField;
17 18
18 @metadata 19 @metadata
19 method() {} 20 method() {}
20 } 21 }
21 22
22 @metadata 23 @metadata
23 method() {} 24 method() {}
24 25
25 main() { 26 main() {
26 var classMirror = reflectType(OneField); 27 var classMirror = reflectType(OneField);
27 var classFieldNames = classMirror.declarations.values 28 var classFieldNames = classMirror.declarations.values
28 .where((v) => v is VariableMirror).map((v) => v.simpleName).toList(); 29 .where((v) => v is VariableMirror).map((v) => v.simpleName).toList();
29 Expect.setEquals([#onlyClassField], classFieldNames); 30 Expect.setEquals([#onlyClassField], classFieldNames);
30 31
31 var libraryMirror = classMirror.owner; 32 var libraryMirror = classMirror.owner;
32 var libraryFieldNames = libraryMirror.declarations.values 33 var libraryFieldNames = libraryMirror.declarations.values
33 .where((v) => v is VariableMirror).map((v) => v.simpleName).toList(); 34 .where((v) => v is VariableMirror).map((v) => v.simpleName).toList();
34 Expect.setEquals([#metadata], libraryFieldNames); 35 Expect.setEquals([#metadata], libraryFieldNames);
35 } 36 }
OLDNEW
« no previous file with comments | « tests/lib/mirrors/regress_16321_test.dart ('k') | tests/lib/mirrors/regress_26187_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698