Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Unified Diff: LayoutTests/http/tests/htmlimports/resources/import-custom-element-helper.js

Issue 249563003: REGRESSION(r171966): Custom elements in async imports don't get upgrade. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();
+ };
+}

Powered by Google App Engine
This is Rietveld 408576698