OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 part of mocks; | 5 part of mocks; |
6 | 6 |
7 class HeapSnapshotMock implements M.HeapSnapshot { | 7 class HeapSnapshotMock implements M.HeapSnapshot { |
8 final DateTime timestamp; | 8 final DateTime timestamp; |
9 final int objects; | 9 final int objects; |
10 final int references; | 10 final int references; |
11 final int size; | 11 final int size; |
12 final M.HeapSnapshotDominatorNode dominatorTree; | 12 final M.HeapSnapshotDominatorNode dominatorTree; |
13 final Iterable<M.HeapSnapshotClassReferences> classReferences; | 13 final Iterable<M.HeapSnapshotClassReferences> classReferences; |
14 | 14 |
15 const HeapSnapshotMock( | 15 const HeapSnapshotMock({this.timestamp, this.objects: 0, |
16 {this.timestamp, | 16 this.references: 0, this.size: 0, |
17 this.objects: 0, | |
18 this.references: 0, | |
19 this.size: 0, | |
20 this.dominatorTree: const HeapSnapshotDominatorNodeMock(), | 17 this.dominatorTree: const HeapSnapshotDominatorNodeMock(), |
21 this.classReferences: const []}); | 18 this.classReferences: const []}); |
22 } | 19 } |
23 | 20 |
24 class HeapSnapshotDominatorNodeMock implements M.HeapSnapshotDominatorNode { | 21 class HeapSnapshotDominatorNodeMock implements M.HeapSnapshotDominatorNode { |
25 final int shallowSize; | 22 final int shallowSize; |
26 final int retainedSize; | 23 final int retainedSize; |
27 final Future<M.ObjectRef> object; | 24 final Future<M.ObjectRef> object; |
28 final Iterable<M.HeapSnapshotDominatorNode> children; | 25 final Iterable<M.HeapSnapshotDominatorNode> children; |
29 | 26 |
30 const HeapSnapshotDominatorNodeMock( | 27 const HeapSnapshotDominatorNodeMock({this.shallowSize: 1, |
31 {this.shallowSize: 1, | 28 this.retainedSize: 1, |
32 this.retainedSize: 1, | 29 this.object, this.children: const []}); |
33 this.object, | |
34 this.children: const []}); | |
35 } | 30 } |
36 | 31 |
37 class HeapSnapshotClassReferencesMock implements M.HeapSnapshotClassReferences { | 32 class HeapSnapshotClassReferencesMock implements M.HeapSnapshotClassReferences { |
38 final M.ClassRef clazz; | 33 final M.ClassRef clazz; |
39 final int instances; | 34 final int instances; |
40 final int shallowSize; | 35 final int shallowSize; |
41 final int retainedSize; | 36 final int retainedSize; |
42 final Iterable<M.HeapSnapshotClassInbound> inbounds; | 37 final Iterable<M.HeapSnapshotClassInbound> inbounds; |
43 final Iterable<M.HeapSnapshotClassOutbound> outbounds; | 38 final Iterable<M.HeapSnapshotClassOutbound> outbounds; |
44 | 39 |
45 const HeapSnapshotClassReferencesMock( | 40 const HeapSnapshotClassReferencesMock({this.clazz: const ClassRefMock(), |
46 {this.clazz: const ClassRefMock(), | 41 this.instances: 1, this.shallowSize: 1, |
47 this.instances: 1, | 42 this.retainedSize: 2, |
48 this.shallowSize: 1, | 43 this.inbounds: const [], |
49 this.retainedSize: 2, | 44 this.outbounds: const []}); |
50 this.inbounds: const [], | |
51 this.outbounds: const []}); | |
52 } | 45 } |
53 | 46 |
54 class HeapSnapshotClassInboundMock implements M.HeapSnapshotClassInbound { | 47 class HeapSnapshotClassInboundMock implements M.HeapSnapshotClassInbound { |
55 final M.ClassRef source; | 48 final M.ClassRef source; |
56 final int count; | 49 final int count; |
57 final int shallowSize; | 50 final int shallowSize; |
58 final int retainedSize; | 51 final int retainedSize; |
59 | 52 |
60 const HeapSnapshotClassInboundMock( | 53 const HeapSnapshotClassInboundMock({this.source: const ClassRefMock(), |
61 {this.source: const ClassRefMock(), | 54 this.count: 1, this.shallowSize: 1, |
62 this.count: 1, | 55 this.retainedSize: 2}); |
63 this.shallowSize: 1, | |
64 this.retainedSize: 2}); | |
65 } | 56 } |
66 | 57 |
67 class HeapSnapshotClassOutboundMock implements M.HeapSnapshotClassOutbound { | 58 class HeapSnapshotClassOutboundMock implements M.HeapSnapshotClassOutbound { |
68 final M.ClassRef target; | 59 final M.ClassRef target; |
69 final int count; | 60 final int count; |
70 final int shallowSize; | 61 final int shallowSize; |
71 final int retainedSize; | 62 final int retainedSize; |
72 const HeapSnapshotClassOutboundMock( | 63 const HeapSnapshotClassOutboundMock({this.target: const ClassRefMock(), |
73 {this.target: const ClassRefMock(), | 64 this.count: 1, this.shallowSize: 1, |
74 this.count: 1, | 65 this.retainedSize: 2}); |
75 this.shallowSize: 1, | |
76 this.retainedSize: 2}); | |
77 } | 66 } |
OLD | NEW |