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

Unified Diff: packages/observable/test/observable_test_utils.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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
« no previous file with comments | « packages/observable/test/observable_test.dart ('k') | packages/observe/.gitignore » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/observable/test/observable_test_utils.dart
diff --git a/packages/observable/test/observable_test_utils.dart b/packages/observable/test/observable_test_utils.dart
new file mode 100644
index 0000000000000000000000000000000000000000..91d4d8fa45f1be046ca492ba71f7c395eeca59f9
--- /dev/null
+++ b/packages/observable/test/observable_test_utils.dart
@@ -0,0 +1,32 @@
+// 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.
+
+library observable.test.observable_test_utils;
+
+import 'dart:async';
+
+import 'package:observable/observable.dart';
+import 'package:test/test.dart';
+
+/// A small method to help readability. Used to cause the next "then" in a chain
+/// to happen in the next microtask:
+///
+/// future.then(newMicrotask).then(...)
+///
+/// Uses [mu].
+newMicrotask(_) => new Future.value();
+
+// TODO(jmesserly): use matchers when we have a way to compare ChangeRecords.
+// For now just use the toString.
+void expectChanges(actual, expected, {String reason}) =>
+ expect('$actual', '$expected', reason: reason);
+
+List<ListChangeRecord> getListChangeRecords(
+ List<ListChangeRecord> changes, int index) =>
+ new List.from(changes.where((ListChangeRecord c) => c.indexChanged(index)));
+
+List<PropertyChangeRecord> getPropertyChangeRecords(
+ List<ChangeRecord> changes, Symbol property) =>
+ new List.from(changes.where(
+ (ChangeRecord c) => c is PropertyChangeRecord && c.name == property));
« no previous file with comments | « packages/observable/test/observable_test.dart ('k') | packages/observe/.gitignore » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698