| OLD | NEW |
| 1 library TestUtils; | 1 library TestUtils; |
| 2 | 2 |
| 3 import 'dart:async'; | 3 import 'dart:async'; |
| 4 import 'dart:html'; | 4 import 'dart:html'; |
| 5 import 'dart:typed_data'; | 5 import 'dart:typed_data'; |
| 6 import 'package:unittest/unittest.dart'; | 6 import 'package:unittest/unittest.dart'; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * Verifies that [actual] has the same graph structure as [expected]. | 9 * Verifies that [actual] has the same graph structure as [expected]. |
| 10 * Detects cycles and DAG structure in Maps and Lists. | 10 * Detects cycles and DAG structure in Maps and Lists. |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 reason: '$path attributes.lengths differ'); | 152 reason: '$path attributes.lengths differ'); |
| 153 for (var key in aE.attributes.keys) { | 153 for (var key in aE.attributes.keys) { |
| 154 expect(aE.attributes[key], bE.attributes[key], | 154 expect(aE.attributes[key], bE.attributes[key], |
| 155 reason: '$path attribute [$key] values differ'); | 155 reason: '$path attribute [$key] values differ'); |
| 156 } | 156 } |
| 157 } | 157 } |
| 158 for (var i = 0; i < a.nodes.length; ++i) { | 158 for (var i = 0; i < a.nodes.length; ++i) { |
| 159 validateNodeTree(a.nodes[i], b.nodes[i], '$path[$i].'); | 159 validateNodeTree(a.nodes[i], b.nodes[i], '$path[$i].'); |
| 160 } | 160 } |
| 161 } | 161 } |
| 162 | |
| 163 Future loadCustomElementPolyfill() { | |
| 164 if (!document.supportsRegister) { | |
| 165 var script = new ScriptElement() | |
| 166 ..src = '/packages/custom_element/custom-elements.debug.js'; | |
| 167 document.head.append(script); | |
| 168 return document.body.on['WebComponentsReady'].first; | |
| 169 } | |
| 170 return new Future.value(); | |
| 171 } | |
| 172 | |
| 173 Future loadPolyfills() { | |
| 174 return loadCustomElementPolyfill(); | |
| 175 } | |
| OLD | NEW |