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

Unified Diff: dart/tests/compiler/dart2js/mirrors_used_test.dart

Issue 21242002: Retain elements a finer granularity than library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 7 years, 4 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 | « dart/tests/compiler/dart2js/message_kind_test.dart ('k') | dart/tests/compiler/dart2js/mock_compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/compiler/dart2js/mirrors_used_test.dart
diff --git a/dart/tests/compiler/dart2js/mirrors_used_test.dart b/dart/tests/compiler/dart2js/mirrors_used_test.dart
index 09fdd29c9b883a28848d4f775b1914e9865e1c14..f3719a5cdc3353b294c976bc46c93e478eb3b18f 100644
--- a/dart/tests/compiler/dart2js/mirrors_used_test.dart
+++ b/dart/tests/compiler/dart2js/mirrors_used_test.dart
@@ -48,7 +48,7 @@ void main() {
// 2. Some code was refactored, and there are more methods.
// Either situation could be problematic, but in situation 2, it is often
// acceptable to increase [expectedMethodCount] a little.
- int expectedMethodCount = 315;
+ int expectedMethodCount = 317;
Expect.isTrue(
generatedCode.length <= expectedMethodCount,
'Too many compiled methods: '
@@ -56,11 +56,15 @@ void main() {
for (var library in compiler.libraries.values) {
library.forEachLocalMember((member) {
- if (library == compiler.mainApp) {
- // TODO(ahe): We currently retain the entire library. Update this test
- // to test that only Foo is retained.
+ if (library == compiler.mainApp
+ && member.name == const SourceString('Foo')) {
Expect.isTrue(
compiler.backend.isNeededForReflection(member), '$member');
+ member.forEachLocalMember((classMember) {
+ Expect.isTrue(
+ compiler.backend.isNeededForReflection(classMember),
+ '$classMember');
+ });
} else {
Expect.isFalse(
compiler.backend.isNeededForReflection(member), '$member');
@@ -76,7 +80,14 @@ import 'dart:mirrors';
import 'library.dart';
-class Foo {}
+class Foo {
+ int field;
+ instanceMethod() {}
+ static staticMethod() {}
+}
+
+unusedFunction() {
+}
main() {
useReflect(Foo);
« no previous file with comments | « dart/tests/compiler/dart2js/message_kind_test.dart ('k') | dart/tests/compiler/dart2js/mock_compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698