Index: third_party/WebKit/LayoutTests/custom-elements/imports/imports-create.html |
diff --git a/third_party/WebKit/LayoutTests/custom-elements/imports/imports-create.html b/third_party/WebKit/LayoutTests/custom-elements/imports/imports-create.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a96a018619c90995780f38c57535947bc56cc533 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/custom-elements/imports/imports-create.html |
@@ -0,0 +1,39 @@ |
+<!DOCTYPE html> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<script> |
+'use strict' |
+setup({ explicit_done: true }); |
+let reactions = []; |
+customElements.define('x-x', class extends HTMLElement { |
+ constructor() { |
+ super(); |
+ reactions.push({ type: 'constructor', element: this }); |
+ console.log("constructor", this); |
+ } |
+}); |
+test(() => { |
+ assert_equals(reactions.length, 0); |
+}, 'Should not have parsed <x-x> yet'); |
+</script> |
+ |
+<x-x></x-x> |
+ |
+<script> |
+test(() => { |
+ assert_equals(reactions.length, 1); |
+}, 'Parser should create custom if after define'); |
+ |
+let import1 = document.createElement('link'); |
+import1.rel = 'import'; |
+import1.href = 'resources/import-custom.html'; |
+document.head.appendChild(import1); |
+ |
+import1.onload = () => { |
+ test(() => { |
+ assert_equals(reactions.length, 2); |
dominicc (has gone to gerrit)
2016/07/13 06:12:30
These presumably have to be in order. Can you push
kojii
2016/07/13 06:47:16
The test does push the actual object. Also the oth
kojii
2016/07/13 07:00:13
Done in PS5.
|
+ }, 'import should create custom if after define'); |
dominicc (has gone to gerrit)
2016/07/13 06:12:30
These descriptions are cryptic; what is create cus
|
+ |
+ done(); |
+}; |
+</script> |