| 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 'dart:html'; |
| 9 import 'package:observe/observe.dart'; | 9 import 'package:observe/observe.dart'; |
| 10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| 11 | 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 |
| 12 toSymbolMap(Map map) { | 18 toSymbolMap(Map map) { |
| 13 var result = new ObservableMap.linked(); | 19 var result = new ObservableMap.linked(); |
| 14 map.forEach((key, value) { | 20 map.forEach((key, value) { |
| 15 if (value is Map) value = toSymbolMap(value); | 21 if (value is Map) value = toSymbolMap(value); |
| 16 result[new Symbol(key)] = value; | 22 result[new Symbol(key)] = value; |
| 17 }); | 23 }); |
| 18 return result; | 24 return result; |
| 19 } | 25 } |
| 20 | 26 |
| 21 recursivelySetTemplateModel(element, model, [delegate]) { | 27 recursivelySetTemplateModel(element, model, [delegate]) { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 } finally { | 93 } finally { |
| 88 performMicrotaskCheckpoint(); | 94 performMicrotaskCheckpoint(); |
| 89 } | 95 } |
| 90 }, onRunAsync: (callback) => _pending.add(callback)); | 96 }, onRunAsync: (callback) => _pending.add(callback)); |
| 91 }; | 97 }; |
| 92 } | 98 } |
| 93 | 99 |
| 94 observeTest(name, testCase) => test(name, wrapMicrotask(testCase)); | 100 observeTest(name, testCase) => test(name, wrapMicrotask(testCase)); |
| 95 | 101 |
| 96 solo_observeTest(name, testCase) => solo_test(name, wrapMicrotask(testCase)); | 102 solo_observeTest(name, testCase) => solo_test(name, wrapMicrotask(testCase)); |
| OLD | NEW |