Index: third_party/WebKit/LayoutTests/custom-elements/imports/imports-upgrade.html |
diff --git a/third_party/WebKit/LayoutTests/custom-elements/imports/imports-upgrade.html b/third_party/WebKit/LayoutTests/custom-elements/imports/imports-upgrade.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1aa8d322ea801aca9d0abd284ffcaeca57b7bc58 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/custom-elements/imports/imports-upgrade.html |
@@ -0,0 +1,29 @@ |
+<!DOCTYPE html> |
+<link id="import1" rel="import" href="resources/import-custom.html" /> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<x-x></x-x> |
+<script> |
+'use strict' |
+ |
+async_test((test) => { |
+ window.onload = test.step_func_done(() => { |
+ let reactions = []; |
+ customElements.define('x-x', class extends HTMLElement { |
+ constructor() { |
+ super(); |
+ reactions.push({ type: 'constructor', element: this }); |
+ } |
+ }); |
+ |
+ assert_equals(reactions.length, 2, 'Upgrade elements in master and import'); |
+ |
+ let elementsInMaster = document.querySelector('x-x'); |
+ let elementsInImport = import1.import.querySelector('x-x'); |
+ |
+ let elements = reactions.map(e => e.element); |
+ assert_array_equals(elements, [elementsInImport, elementsInMaster], |
+ 'Upgrade elements in import should be done first.'); |
+ }); |
+}, 'Test for Custom Element upgrade in imports'); |
+</script> |