Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Unified Diff: runtime/observatory/tests/observatory_ui/mocks/objects/heap_snapshot.dart

Issue 2266343002: Converted Observatory heap-snapshot element (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Removed debug code Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/observatory/tests/observatory_ui/mocks/objects/heap_snapshot.dart
diff --git a/runtime/observatory/tests/observatory_ui/mocks/objects/heap_snapshot.dart b/runtime/observatory/tests/observatory_ui/mocks/objects/heap_snapshot.dart
new file mode 100644
index 0000000000000000000000000000000000000000..1763ba3bb6976b13cae321a85f36b0afb1e5a56d
--- /dev/null
+++ b/runtime/observatory/tests/observatory_ui/mocks/objects/heap_snapshot.dart
@@ -0,0 +1,66 @@
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of mocks;
+
+class HeapSnapshotMock implements M.HeapSnapshot {
+ final DateTime timestamp;
+ final int objects;
+ final int references;
+ final int size;
+ final M.HeapSnapshotDominatorNode dominatorTree;
+ final Iterable<M.HeapSnapshotClassReferences> classReferences;
+
+ const HeapSnapshotMock({this.timestamp, this.objects: 0,
+ this.references: 0, this.size: 0,
+ this.dominatorTree: const HeapSnapshotDominatorNodeMock(),
+ this.classReferences: const []});
+}
+
+class HeapSnapshotDominatorNodeMock implements M.HeapSnapshotDominatorNode {
+ final int shallowSize;
+ final int retainedSize;
+ final Future<M.ObjectRef> object;
+ final Iterable<M.HeapSnapshotDominatorNode> children;
+
+ const HeapSnapshotDominatorNodeMock({this.shallowSize: 1,
+ this.retainedSize: 1,
+ this.object, this.children: const []});
+}
+
+class HeapSnapshotClassReferencesMock implements M.HeapSnapshotClassReferences {
+ final M.ClassRef clazz;
+ final int instances;
+ final int shallowSize;
+ final int retainedSize;
+ final Iterable<M.HeapSnapshotClassInbound> inbounds;
+ final Iterable<M.HeapSnapshotClassOutbound> outbounds;
+
+ const HeapSnapshotClassReferencesMock({this.clazz: const ClassRefMock(),
+ this.instances: 1, this.shallowSize: 1,
+ this.retainedSize: 2,
+ this.inbounds: const [],
+ this.outbounds: const []});
+}
+
+class HeapSnapshotClassInboundMock implements M.HeapSnapshotClassInbound {
+ final M.ClassRef source;
+ final int count;
+ final int shallowSize;
+ final int retainedSize;
+
+ const HeapSnapshotClassInboundMock({this.source: const ClassRefMock(),
+ this.count: 1, this.shallowSize: 1,
+ this.retainedSize: 2});
+}
+
+class HeapSnapshotClassOutboundMock implements M.HeapSnapshotClassOutbound {
+ final M.ClassRef target;
+ final int count;
+ final int shallowSize;
+ final int retainedSize;
+ const HeapSnapshotClassOutboundMock({this.target: const ClassRefMock(),
+ this.count: 1, this.shallowSize: 1,
+ this.retainedSize: 2});
+}

Powered by Google App Engine
This is Rietveld 408576698