Index: runtime/observatory/tests/service/dominator_tree_user_test.dart |
diff --git a/runtime/observatory/tests/service/dominator_tree_user_test.dart b/runtime/observatory/tests/service/dominator_tree_user_test.dart |
index c312dd0fedae06532d60378c34db65605442e1a2..e81f4705868baedc16a7a2b796235cc0c9762f32 100644 |
--- a/runtime/observatory/tests/service/dominator_tree_user_test.dart |
+++ b/runtime/observatory/tests/service/dominator_tree_user_test.dart |
@@ -10,19 +10,65 @@ import 'package:unittest/unittest.dart'; |
import 'test_helper.dart'; |
// small example from [Lenguaer & Tarjan 1979] |
-class R { var x; var y; var z; } |
-class A { var x; } |
-class B { var x; var y; var z; } |
-class C { var x; var y; } |
-class D { var x; } |
-class E { var x; } |
-class F { var x; } |
-class G { var x; var y; } |
-class H { var x; var y; } |
-class I { var x; } |
-class J { var x; } |
-class K { var x; var y; } |
-class L { var x; } |
+class R { |
+ var x; |
+ var y; |
+ var z; |
+} |
+ |
+class A { |
+ var x; |
+} |
+ |
+class B { |
+ var x; |
+ var y; |
+ var z; |
+} |
+ |
+class C { |
+ var x; |
+ var y; |
+} |
+ |
+class D { |
+ var x; |
+} |
+ |
+class E { |
+ var x; |
+} |
+ |
+class F { |
+ var x; |
+} |
+ |
+class G { |
+ var x; |
+ var y; |
+} |
+ |
+class H { |
+ var x; |
+ var y; |
+} |
+ |
+class I { |
+ var x; |
+} |
+ |
+class J { |
+ var x; |
+} |
+ |
+class K { |
+ var x; |
+ var y; |
+} |
+ |
+class L { |
+ var x; |
+} |
var r; |
@@ -41,50 +87,58 @@ buildGraph() { |
var k = new K(); |
var l = new L(); |
- r.x = a; r.y = b; r.z = c; |
+ r.x = a; |
+ r.y = b; |
+ r.z = c; |
a.x = d; |
- b.x = a; b.y = d; b.z = e; |
- c.x = f; c.y = g; |
+ b.x = a; |
+ b.y = d; |
+ b.z = e; |
+ c.x = f; |
+ c.y = g; |
d.x = l; |
e.x = h; |
f.x = i; |
- g.x = i; g.y = j; |
- h.x = e; h.y = k; |
+ g.x = i; |
+ g.y = j; |
+ h.x = e; |
+ h.y = k; |
i.x = k; |
j.x = i; |
- k.x = i; k.y = r; |
+ k.x = i; |
+ k.y = r; |
l.x = h; |
} |
var tests = [ |
-(Isolate isolate) async { |
- final rootLib = await isolate.rootLibrary.load(); |
- final raw = |
- await isolate.fetchHeapSnapshot(M.HeapSnapshotRoots.user, false).last; |
- final snapshot = new HeapSnapshot(); |
- await snapshot.loadProgress(isolate, raw).last; |
- |
- node(String className) { |
- var cls = rootLib.classes.singleWhere((cls) => cls.name == className); |
- return snapshot.graph.vertices.singleWhere((v) => v.vmCid == cls.vmCid); |
- } |
- |
- expect(node('I').dominator, equals(node('R'))); |
- expect(node('K').dominator, equals(node('R'))); |
- expect(node('C').dominator, equals(node('R'))); |
- expect(node('H').dominator, equals(node('R'))); |
- expect(node('E').dominator, equals(node('R'))); |
- expect(node('A').dominator, equals(node('R'))); |
- expect(node('D').dominator, equals(node('R'))); |
- expect(node('B').dominator, equals(node('R'))); |
- |
- expect(node('F').dominator, equals(node('C'))); |
- expect(node('G').dominator, equals(node('C'))); |
- expect(node('J').dominator, equals(node('G'))); |
- expect(node('L').dominator, equals(node('D'))); |
- |
- expect(node('R'), isNotNull); // The field. |
-}, |
+ (Isolate isolate) async { |
+ final rootLib = await isolate.rootLibrary.load(); |
+ final raw = |
+ await isolate.fetchHeapSnapshot(M.HeapSnapshotRoots.user, false).last; |
+ final snapshot = new HeapSnapshot(); |
+ await snapshot.loadProgress(isolate, raw).last; |
+ |
+ node(String className) { |
+ var cls = rootLib.classes.singleWhere((cls) => cls.name == className); |
+ return snapshot.graph.vertices.singleWhere((v) => v.vmCid == cls.vmCid); |
+ } |
+ |
+ expect(node('I').dominator, equals(node('R'))); |
+ expect(node('K').dominator, equals(node('R'))); |
+ expect(node('C').dominator, equals(node('R'))); |
+ expect(node('H').dominator, equals(node('R'))); |
+ expect(node('E').dominator, equals(node('R'))); |
+ expect(node('A').dominator, equals(node('R'))); |
+ expect(node('D').dominator, equals(node('R'))); |
+ expect(node('B').dominator, equals(node('R'))); |
+ |
+ expect(node('F').dominator, equals(node('C'))); |
+ expect(node('G').dominator, equals(node('C'))); |
+ expect(node('J').dominator, equals(node('G'))); |
+ expect(node('L').dominator, equals(node('D'))); |
+ |
+ expect(node('R'), isNotNull); // The field. |
+ }, |
]; |
main(args) => runIsolateTests(args, tests, testeeBefore: buildGraph); |