Index: third_party/WebKit/LayoutTests/custom-elements/imports/upgrade-order.html |
diff --git a/third_party/WebKit/LayoutTests/custom-elements/imports/upgrade-order.html b/third_party/WebKit/LayoutTests/custom-elements/imports/upgrade-order.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..eb9728e7c5ac2283dd1e636394e35af544c5f83b |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/custom-elements/imports/upgrade-order.html |
@@ -0,0 +1,30 @@ |
+<!DOCTYPE html> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<script> |
+'use strict'; |
+ |
+let reactions = []; |
+</script> |
+<x-x id="a"></x-x> |
+<y-y id="x"></y-y> |
+<link id="import1" rel="import" href="resources/upgrade.html"> |
+<x-x id="b"></x-x> |
+<y-y id="y"></y-y> |
+<script> |
+'use strict' |
+ |
+async_test((test) => { |
+ window.onload = test.step_func_done(() => { |
+ customElements.define('y-y', class extends HTMLElement { |
+ constructor() { |
+ super(); |
+ reactions.push({ type: 'constructor', element: this }); |
+ } |
+ }); |
+ |
+ let elements = reactions.map(e => e.element.id); |
+ assert_array_equals(elements, ['a', 'aa', 'b', 'x', 'bb', 'y']); |
+ }, 'Upgrade of custom elements should happen in document order.'); |
+}); |
+</script> |