| 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 template_element_test; | 5 library template_element_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:html'; | 9 import 'dart:html'; |
| 10 import 'dart:math' as math; | 10 import 'dart:math' as math; |
| (...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1111 'name': 'one', 'items': [{ 'val': 0 }, { 'val': 1 }] | 1111 'name': 'one', 'items': [{ 'val': 0 }, { 'val': 1 }] |
| 1112 }], | 1112 }], |
| 1113 }); | 1113 }); |
| 1114 | 1114 |
| 1115 recursivelySetTemplateModel(div, m); | 1115 recursivelySetTemplateModel(div, m); |
| 1116 deliverChanges(m); | 1116 deliverChanges(m); |
| 1117 | 1117 |
| 1118 var select = div.nodes[0].nextNode; | 1118 var select = div.nodes[0].nextNode; |
| 1119 expect(select.nodes.length, 2); | 1119 expect(select.nodes.length, 2); |
| 1120 | 1120 |
| 1121 runAsync(expectAsync0(() { | 1121 scheduleMicrotask(expectAsync0(() { |
| 1122 runAsync(expectAsync0(() { | 1122 scheduleMicrotask(expectAsync0(() { |
| 1123 // TODO(jmesserly): this should be called sooner. | 1123 // TODO(jmesserly): this should be called sooner. |
| 1124 expect(select.selectedIndex, 1); | 1124 expect(select.selectedIndex, 1); |
| 1125 })); | 1125 })); |
| 1126 })); | 1126 })); |
| 1127 expect(select.nodes[0].tagName, 'TEMPLATE'); | 1127 expect(select.nodes[0].tagName, 'TEMPLATE'); |
| 1128 expect(select.nodes[0].ref.content.nodes[0].tagName, 'OPTGROUP'); | 1128 expect(select.nodes[0].ref.content.nodes[0].tagName, 'OPTGROUP'); |
| 1129 | 1129 |
| 1130 var optgroup = select.nodes[1]; | 1130 var optgroup = select.nodes[1]; |
| 1131 expect(optgroup.nodes[0].tagName, 'TEMPLATE'); | 1131 expect(optgroup.nodes[0].tagName, 'TEMPLATE'); |
| 1132 expect(optgroup.nodes[1].tagName, 'OPTION'); | 1132 expect(optgroup.nodes[1].tagName, 'OPTION'); |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1779 } | 1779 } |
| 1780 return value; | 1780 return value; |
| 1781 } | 1781 } |
| 1782 | 1782 |
| 1783 /** | 1783 /** |
| 1784 * Sanitizer which does nothing. | 1784 * Sanitizer which does nothing. |
| 1785 */ | 1785 */ |
| 1786 class NullTreeSanitizer implements NodeTreeSanitizer { | 1786 class NullTreeSanitizer implements NodeTreeSanitizer { |
| 1787 void sanitizeTree(Node node) {} | 1787 void sanitizeTree(Node node) {} |
| 1788 } | 1788 } |
| OLD | NEW |