Chromium Code Reviews| Index: LayoutTests/fast/html/imports/resources/import-custom-element-helper.js |
| diff --git a/LayoutTests/fast/html/imports/resources/import-custom-element-helper.js b/LayoutTests/fast/html/imports/resources/import-custom-element-helper.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1f712beec7963d3e84d671d253b4c785b25a9352 |
| --- /dev/null |
| +++ b/LayoutTests/fast/html/imports/resources/import-custom-element-helper.js |
| @@ -0,0 +1,17 @@ |
| + |
| +function registerTestingCustomElement(tagName) { |
| + var definition = function() {}; |
| + definition.ids = []; |
| + definition.prototype = Object.create(HTMLElement.prototype); |
| + definition.prototype.createdCallback = function() { definition.ids.push(this.id); } |
| + document.registerElement(tagName, definition); |
| + return definition; |
|
dominicc (has gone to gerrit)
2014/04/25 02:39:45
Why not just set up the prototype and return the g
|
| +} |
| + |
| +function ImportTestLatch(test, count) { |
| + this.loaded = function() { |
| + count--; |
| + if (!count) |
| + test(); |
| + }; |
| +} |