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 AllocationProfileMock implements M.AllocationProfile { | 7 class AllocationProfileMock implements M.AllocationProfile { |
8 final DateTime lastServiceGC; | 8 final DateTime lastServiceGC; |
9 final DateTime lastAccumulatorReset; | 9 final DateTime lastAccumulatorReset; |
10 final M.HeapSpace newSpace; | 10 final M.HeapSpace newSpace; |
11 final M.HeapSpace oldSpace; | 11 final M.HeapSpace oldSpace; |
12 final Iterable<M.ClassHeapStats> members; | 12 final Iterable<M.ClassHeapStats> members; |
13 | 13 |
14 const AllocationProfileMock( | 14 const AllocationProfileMock({this.lastServiceGC, this.lastAccumulatorReset, |
15 {this.lastServiceGC, | 15 this.newSpace: const HeapSpaceMock(), |
16 this.lastAccumulatorReset, | 16 this.oldSpace: const HeapSpaceMock(), |
17 this.newSpace: const HeapSpaceMock(), | 17 this.members: const []}); |
18 this.oldSpace: const HeapSpaceMock(), | |
19 this.members: const []}); | |
20 } | 18 } |
21 | 19 |
| 20 |
22 class ClassHeapStatsMock implements M.ClassHeapStats { | 21 class ClassHeapStatsMock implements M.ClassHeapStats { |
23 final M.ClassRef clazz; | 22 final M.ClassRef clazz; |
24 final M.Allocations newSpace; | 23 final M.Allocations newSpace; |
25 final M.Allocations oldSpace; | 24 final M.Allocations oldSpace; |
26 final int promotedInstances; | 25 final int promotedInstances; |
27 final int promotedBytes; | 26 final int promotedBytes; |
28 | 27 |
29 const ClassHeapStatsMock( | 28 const ClassHeapStatsMock({this.clazz: const ClassRefMock(), |
30 {this.clazz: const ClassRefMock(), | 29 this.newSpace: const AllocationsMock(), |
31 this.newSpace: const AllocationsMock(), | 30 this.oldSpace: const AllocationsMock(), |
32 this.oldSpace: const AllocationsMock(), | 31 this.promotedInstances: 0, this.promotedBytes: 0}); |
33 this.promotedInstances: 0, | |
34 this.promotedBytes: 0}); | |
35 } | 32 } |
36 | 33 |
37 class AllocationsMock implements M.Allocations { | 34 class AllocationsMock implements M.Allocations { |
38 final M.AllocationCount accumulated; | 35 final M.AllocationCount accumulated; |
39 final M.AllocationCount current; | 36 final M.AllocationCount current; |
40 | 37 |
41 const AllocationsMock( | 38 const AllocationsMock({this.accumulated: const AllocationCountMock(), |
42 {this.accumulated: const AllocationCountMock(), | 39 this.current: const AllocationCountMock()}); |
43 this.current: const AllocationCountMock()}); | |
44 } | 40 } |
45 | 41 |
46 class AllocationCountMock implements M.AllocationCount { | 42 class AllocationCountMock implements M.AllocationCount { |
47 final int instances; | 43 final int instances; |
48 final int bytes; | 44 final int bytes; |
49 | 45 |
50 const AllocationCountMock({this.instances: 0, this.bytes: 0}); | 46 const AllocationCountMock({this.instances: 0, this.bytes: 0}); |
51 } | 47 } |
OLD | NEW |