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

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

Issue 24076005: fix observing superclass fields, issue 13255 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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/lib/src/observable.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/observe/test/observe_test.dart
diff --git a/pkg/observe/test/observe_test.dart b/pkg/observe/test/observe_test.dart
index b181ccb7bdaeb3babffac9046383835a90b99373..da58c3b522cde9f0b596d11e10ceb397bbcc6dbf 100644
--- a/pkg/observe/test/observe_test.dart
+++ b/pkg/observe/test/observe_test.dart
@@ -22,9 +22,11 @@ void main() {
expect(dirty_check.allObservablesCount, 0);
});
- group('WatcherModel', () { _observeTests(watch: true); });
+ group('WatcherModel', () => _observeTests((x) => new WatcherModel(x)));
- group('ObservableBox', () { _observeTests(); });
+ group('ObservableBox', () => _observeTests((x) => new ObservableBox(x)));
+
+ group('ModelSubclass', () => _observeTests((x) => new ModelSubclass(x)));
group('dirtyCheck loops can be debugged', () {
var messages;
@@ -60,9 +62,8 @@ void main() {
});
}
-void _observeTests({bool watch: false}) {
- final createModel = watch ? (x) => new WatcherModel(x)
- : (x) => new ObservableBox(x);
+void _observeTests(createModel(x)) {
+ final watch = createModel(null) is! ChangeNotifierMixin;
// Track the subscriptions so we can clean them up in tearDown.
List subs;
@@ -255,3 +256,7 @@ class WatcherModel<T> extends ObservableBase {
String toString() => '#<$runtimeType value: $value>';
}
+
+class ModelSubclass<T> extends WatcherModel<T> {
+ ModelSubclass([T initialValue]) : super(initialValue);
+}
« no previous file with comments | « pkg/observe/lib/src/observable.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698