| 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 library observe_utils; | 5 library observe_utils; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:html'; |
| 8 import 'package:observe/observe.dart'; | 9 import 'package:observe/observe.dart'; |
| 9 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| 10 | 11 |
| 12 final bool parserHasNativeTemplate = () { |
| 13 var div = new DivElement()..innerHtml = '<table><template>'; |
| 14 return div.firstChild.firstChild != null && |
| 15 div.firstChild.firstChild.tagName == 'TEMPLATE'; |
| 16 }(); |
| 17 |
| 11 toSymbolMap(Map map) { | 18 toSymbolMap(Map map) { |
| 12 var result = new ObservableMap.linked(); | 19 var result = new ObservableMap.linked(); |
| 13 map.forEach((key, value) { | 20 map.forEach((key, value) { |
| 14 if (value is Map) value = toSymbolMap(value); | 21 if (value is Map) value = toSymbolMap(value); |
| 15 result[new Symbol(key)] = value; | 22 result[new Symbol(key)] = value; |
| 16 }); | 23 }); |
| 17 return result; | 24 return result; |
| 18 } | 25 } |
| 19 | 26 |
| 20 class FooBarModel extends ObservableBase { | 27 class FooBarModel extends ObservableBase { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 } finally { | 80 } finally { |
| 74 performMicrotaskCheckpoint(); | 81 performMicrotaskCheckpoint(); |
| 75 } | 82 } |
| 76 }, onRunAsync: (callback) => _pending.add(callback)); | 83 }, onRunAsync: (callback) => _pending.add(callback)); |
| 77 }; | 84 }; |
| 78 } | 85 } |
| 79 | 86 |
| 80 observeTest(name, testCase) => test(name, wrapMicrotask(testCase)); | 87 observeTest(name, testCase) => test(name, wrapMicrotask(testCase)); |
| 81 | 88 |
| 82 solo_observeTest(name, testCase) => solo_test(name, wrapMicrotask(testCase)); | 89 solo_observeTest(name, testCase) => solo_test(name, wrapMicrotask(testCase)); |
| OLD | NEW |