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

Side by Side Diff: runtime/observatory/tests/service/graph_test.dart

Issue 1584223006: Remove signature classes from the VM. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync Created 4 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
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 // VMOptions=--error_on_bad_type --error_on_bad_override 4 // VMOptions=--error_on_bad_type --error_on_bad_override
5 5
6 import 'package:observatory/object_graph.dart'; 6 import 'package:observatory/object_graph.dart';
7 import 'package:observatory/service_io.dart'; 7 import 'package:observatory/service_io.dart';
8 import 'package:unittest/unittest.dart'; 8 import 'package:unittest/unittest.dart';
9 import 'test_helper.dart'; 9 import 'test_helper.dart';
10 10
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 (ObjectVertex obj) => obj.successors.length == 2).first; 64 (ObjectVertex obj) => obj.successors.length == 2).first;
65 65
66 // TODO(koda): Check actual byte sizes. 66 // TODO(koda): Check actual byte sizes.
67 67
68 expect(aVertex.retainedSize, equals(aVertex.shallowSize)); 68 expect(aVertex.retainedSize, equals(aVertex.shallowSize));
69 expect(bVertex.retainedSize, equals(bVertex.shallowSize)); 69 expect(bVertex.retainedSize, equals(bVertex.shallowSize));
70 expect(rVertex.retainedSize, equals(aVertex.shallowSize + 70 expect(rVertex.retainedSize, equals(aVertex.shallowSize +
71 bVertex.shallowSize + 71 bVertex.shallowSize +
72 rVertex.shallowSize)); 72 rVertex.shallowSize));
73 73
74 const int fixedSizeListCid = 62; 74 Library corelib =
75 isolate.libraries.singleWhere((lib) => lib.uri == 'dart:core');
76 await corelib.load();
77 Class _List =
78 corelib.classes.singleWhere((cls) => cls.vmName.startsWith('_List'));
79 int kArrayCid = _List.vmCid;
80 // startsWith to ignore the private mangling
75 List<ObjectVertex> lists = new List.from(graph.vertices.where( 81 List<ObjectVertex> lists = new List.from(graph.vertices.where(
76 (ObjectVertex obj) => obj.vmCid == fixedSizeListCid)); 82 (ObjectVertex obj) => obj.vmCid == kArrayCid));
77 expect(lists.length >= 2, isTrue); 83 expect(lists.length >= 2, isTrue);
78 // Order by decreasing retained size. 84 // Order by decreasing retained size.
79 lists.sort((u, v) => v.retainedSize - u.retainedSize); 85 lists.sort((u, v) => v.retainedSize - u.retainedSize);
80 ObjectVertex first = lists[0]; 86 ObjectVertex first = lists[0];
81 ObjectVertex second = lists[1]; 87 ObjectVertex second = lists[1];
82 // Check that the short list retains more than the long list inside. 88 // Check that the short list retains more than the long list inside.
83 expect(first.successors.length, 89 expect(first.successors.length,
84 equals(2 + second.successors.length)); 90 equals(2 + second.successors.length));
85 // ... and specifically, that it retains exactly itself + the long one. 91 // ... and specifically, that it retains exactly itself + the long one.
86 expect(first.retainedSize, 92 expect(first.retainedSize,
87 equals(first.shallowSize + second.shallowSize)); 93 equals(first.shallowSize + second.shallowSize));
88 }, 94 },
89 95
90 ]; 96 ];
91 97
92 main(args) => runIsolateTests(args, tests, testeeBefore: script); 98 main(args) => runIsolateTests(args, tests, testeeBefore: script);
OLDNEW
« no previous file with comments | « runtime/observatory/tests/service/get_allocation_samples_test.dart ('k') | runtime/vm/bootstrap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698