| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'package:logging/logging.dart'; | 6 import 'package:logging/logging.dart'; |
| 7 import 'package:observe/observe.dart'; | 7 import 'package:observe/observe.dart'; |
| 8 import 'package:observe/src/dirty_check.dart' as dirty_check; | 8 import 'package:observe/src/dirty_check.dart' as dirty_check; |
| 9 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
| 10 import 'observe_test_utils.dart'; | 10 import 'observe_test_utils.dart'; |
| 11 | 11 |
| 12 main() => dirtyCheckZone().run(_tests); | 12 import 'package:observe/mirrors_used.dart'; // make test smaller. |
| 13 import 'package:smoke/mirrors.dart'; |
| 14 |
| 15 main() { |
| 16 useMirrors(); |
| 17 dirtyCheckZone().run(_tests); |
| 18 } |
| 13 | 19 |
| 14 void _tests() { | 20 void _tests() { |
| 15 // Note: to test the basic Observable system, we use ObservableBox due to its | 21 // Note: to test the basic Observable system, we use ObservableBox due to its |
| 16 // simplicity. We also test a variant that is based on dirty-checking. | 22 // simplicity. We also test a variant that is based on dirty-checking. |
| 17 | 23 |
| 18 test('no observers at the start', () { | 24 test('no observers at the start', () { |
| 19 expect(dirty_check.allObservablesCount, 0); | 25 expect(dirty_check.allObservablesCount, 0); |
| 20 }); | 26 }); |
| 21 | 27 |
| 22 group('WatcherModel', () => _observeTests((x) => new WatcherModel(x))); | 28 group('WatcherModel', () => _observeTests((x) => new WatcherModel(x))); |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 @observable T value; | 268 @observable T value; |
| 263 | 269 |
| 264 WatcherModel([T initialValue]) : value = initialValue; | 270 WatcherModel([T initialValue]) : value = initialValue; |
| 265 | 271 |
| 266 String toString() => '#<$runtimeType value: $value>'; | 272 String toString() => '#<$runtimeType value: $value>'; |
| 267 } | 273 } |
| 268 | 274 |
| 269 class ModelSubclass<T> extends WatcherModel<T> { | 275 class ModelSubclass<T> extends WatcherModel<T> { |
| 270 ModelSubclass([T initialValue]) : super(initialValue); | 276 ModelSubclass([T initialValue]) : super(initialValue); |
| 271 } | 277 } |
| OLD | NEW |