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

Unified Diff: runtime/observatory/tests/observatory_ui/mocks/repositories/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/repositories/heap_snapshot.dart
diff --git a/runtime/observatory/tests/observatory_ui/mocks/repositories/heap_snapshot.dart b/runtime/observatory/tests/observatory_ui/mocks/repositories/heap_snapshot.dart
new file mode 100644
index 0000000000000000000000000000000000000000..42f93e3cbbc981d82f07298f0ada988af38723f9
--- /dev/null
+++ b/runtime/observatory/tests/observatory_ui/mocks/repositories/heap_snapshot.dart
@@ -0,0 +1,47 @@
+// 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 HeapSnapshotLoadingProgressEventMock
+ implements M.HeapSnapshotLoadingProgressEvent {
+ final M.HeapSnapshotLoadingProgress progress;
+
+ const HeapSnapshotLoadingProgressEventMock(
+ {this.progress: const HeapSnapshotLoadingProgressMock()});
+}
+
+class HeapSnapshotLoadingProgressMock implements M.HeapSnapshotLoadingProgress {
+ final M.HeapSnapshotLoadingStatus status;
+ final String stepDescription;
+ final double progress;
+ final Duration fetchingTime;
+ final Duration loadingTime;
+ final M.HeapSnapshot snapshot;
+
+ const HeapSnapshotLoadingProgressMock({
+ this.status : M.HeapSnapshotLoadingStatus.fetching, this.progress: 0.0,
+ this.stepDescription: '', this.fetchingTime, this.loadingTime,
+ this.snapshot});
+}
+
+typedef Stream<M.HeapSnapshotLoadingProgressEvent>
+ HeapSnapshotRepositoryMockCallback(M.IsolateRef cls, bool gc);
+
+class HeapSnapshotRepositoryMock
+ implements M.HeapSnapshotRepository {
+ final HeapSnapshotRepositoryMockCallback _get;
+
+ Stream<M.HeapSnapshotLoadingProgressEvent> get(M.IsolateRef isolate,
+ {bool gc: false}) {
+ if (_get != null) {
+ return _get(isolate, gc);
+ }
+ return null;
+ }
+
+ HeapSnapshotRepositoryMock(
+ {HeapSnapshotRepositoryMockCallback getter})
+ : _get = getter;
+}

Powered by Google App Engine
This is Rietveld 408576698