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