| 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:html' show PathObserver; | |
| 6 import 'package:unittest/html_config.dart'; | |
| 7 import 'package:mdv_observe/mdv_observe.dart'; | 5 import 'package:mdv_observe/mdv_observe.dart'; |
| 8 import 'package:unittest/unittest.dart'; | 6 import 'package:unittest/unittest.dart'; |
| 9 | 7 |
| 10 // This file contains code ported from: | 8 // This file contains code ported from: |
| 11 // https://github.com/rafaelw/ChangeSummary/blob/master/tests/test.js | 9 // https://github.com/rafaelw/ChangeSummary/blob/master/tests/test.js |
| 12 | 10 |
| 13 main() { | 11 main() { |
| 14 useHtmlConfiguration(); | |
| 15 group('PathObserver', observePathTests); | 12 group('PathObserver', observePathTests); |
| 16 } | 13 } |
| 17 | 14 |
| 18 observePath(obj, path) => new PathObserver(obj, path); | 15 observePath(obj, path) => new PathObserver(obj, path); |
| 19 | 16 |
| 20 sym(x) => new Symbol(x); | 17 sym(x) => new Symbol(x); |
| 21 | 18 |
| 22 toSymbolMap(Map map) { | 19 toSymbolMap(Map map) { |
| 23 var result = new ObservableMap.linked(); | 20 var result = new ObservableMap.linked(); |
| 24 map.forEach((key, value) { | 21 map.forEach((key, value) { |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 } | 243 } |
| 247 void setValueWorkaround(key, newValue) { | 244 void setValueWorkaround(key, newValue) { |
| 248 if (key == fieldName) value = newValue; | 245 if (key == fieldName) value = newValue; |
| 249 } | 246 } |
| 250 | 247 |
| 251 toString() => '#<$runtimeType $fieldName: $_value>'; | 248 toString() => '#<$runtimeType $fieldName: $_value>'; |
| 252 } | 249 } |
| 253 | 250 |
| 254 _record(key, oldValue, newValue, [kind = ChangeRecord.FIELD]) => | 251 _record(key, oldValue, newValue, [kind = ChangeRecord.FIELD]) => |
| 255 new ChangeRecord(key, oldValue, newValue, kind: kind); | 252 new ChangeRecord(key, oldValue, newValue, kind: kind); |
| OLD | NEW |