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 'package:observe/observe.dart'; | 5 import 'package:observe/observe.dart'; |
6 import 'package:unittest/unittest.dart'; | 6 import 'package:unittest/unittest.dart'; |
7 import 'observe_test_utils.dart'; | 7 import 'observe_test_utils.dart'; |
8 | 8 |
9 // This file contains code ported from: | 9 // This file contains code ported from: |
10 // https://github.com/rafaelw/ChangeSummary/blob/master/tests/test.js | 10 // https://github.com/rafaelw/ChangeSummary/blob/master/tests/test.js |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 performMicrotaskCheckpoint(); | 217 performMicrotaskCheckpoint(); |
218 expect(values, [1, 2]); | 218 expect(values, [1, 2]); |
219 | 219 |
220 sub.cancel(); | 220 sub.cancel(); |
221 model[#a] = 3; | 221 model[#a] = 3; |
222 performMicrotaskCheckpoint(); | 222 performMicrotaskCheckpoint(); |
223 expect(values, [1, 2]); | 223 expect(values, [1, 2]); |
224 }); | 224 }); |
225 } | 225 } |
226 | 226 |
| 227 @reflectable |
227 class TestModel extends ChangeNotifierBase { | 228 class TestModel extends ChangeNotifierBase { |
228 var _a, _b, _c; | 229 var _a, _b, _c; |
229 | 230 |
230 TestModel(); | 231 TestModel(); |
231 | 232 |
232 get a => _a; | 233 get a => _a; |
233 | 234 |
234 void set a(newValue) { | 235 void set a(newValue) { |
235 _a = notifyPropertyChange(#a, _a, newValue); | 236 _a = notifyPropertyChange(#a, _a, newValue); |
236 } | 237 } |
(...skipping 13 matching lines...) Expand all Loading... |
250 | 251 |
251 class WatcherModel extends ObservableBase { | 252 class WatcherModel extends ObservableBase { |
252 // TODO(jmesserly): dart2js does not let these be on the same line: | 253 // TODO(jmesserly): dart2js does not let these be on the same line: |
253 // @observable var a, b, c; | 254 // @observable var a, b, c; |
254 @observable var a; | 255 @observable var a; |
255 @observable var b; | 256 @observable var b; |
256 @observable var c; | 257 @observable var c; |
257 | 258 |
258 WatcherModel(); | 259 WatcherModel(); |
259 } | 260 } |
OLD | NEW |