Index: LayoutTests/http/tests/htmlimports/resources/import-custom-element-helper.js |
diff --git a/LayoutTests/http/tests/htmlimports/resources/import-custom-element-helper.js b/LayoutTests/http/tests/htmlimports/resources/import-custom-element-helper.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..47d3e5cfe70a65ea408de6e867aefe04ba6230fc |
--- /dev/null |
+++ b/LayoutTests/http/tests/htmlimports/resources/import-custom-element-helper.js |
@@ -0,0 +1,21 @@ |
+ |
+function registerTestingCustomElement(tagName) { |
+ var definition = function() {}; |
+ definition.prototype = Object.create(HTMLElement.prototype); |
+ definition.prototype.createdCallback = function() { |
+ if (typeof this.constructor.ids === "undefined") |
+ this.constructor.ids = []; |
+ this.constructor.ids.push(this.id); |
+ } |
+ |
+ var ctor = document.registerElement(tagName, definition); |
+ return ctor; |
+} |
+ |
+function ImportTestLatch(test, count) { |
+ this.loaded = function() { |
+ count--; |
+ if (!count) |
+ test(); |
+ }; |
+} |