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