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

Unified Diff: pkg/observe/test/observe_test_utils.dart

Issue 27618002: package:observe fix various api issues (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | « pkg/observe/test/observe_test.dart ('k') | pkg/observe/test/path_observer_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/observe/test/observe_test_utils.dart
diff --git a/pkg/observe/test/observe_test_utils.dart b/pkg/observe/test/observe_test_utils.dart
index 2937c07a851f5effee9c80c196a4c3bf94bc49c3..2025e1b87addf546708cd4727d9ecfcb050064da 100644
--- a/pkg/observe/test/observe_test_utils.dart
+++ b/pkg/observe/test/observe_test_utils.dart
@@ -4,6 +4,8 @@
library observe.test.observe_test_utils;
+import 'package:observe/observe.dart';
+
import 'package:unittest/unittest.dart';
import 'package:observe/src/microtask.dart';
@@ -14,6 +16,12 @@ export 'package:observe/src/microtask.dart';
expectChanges(actual, expected, {reason}) =>
expect('$actual', '$expected', reason: reason);
+List getListChangeRecords(List changes, int index) => changes
+ .where((c) => c is ListChangeRecord && c.indexChanged(index)).toList();
+
+List getPropertyChangeRecords(List changes, Symbol property) => changes
+ .where((c) => c is PropertyChangeRecord && c.name == property).toList();
+
/**
* This is a special kind of unit [test], that supports
* calling [performMicrotaskCheckpoint] during the test to pump events
« no previous file with comments | « pkg/observe/test/observe_test.dart ('k') | pkg/observe/test/path_observer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698