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..5baafe8c30d099628f03543723d3cb5f11cef93d |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/custom-elements/imports/imports-upgrade.html |
@@ -0,0 +1,31 @@ |
+<!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' |
+setup({ explicit_done: true }); |
+window.onload = function () { |
+ let reactions = []; |
+ customElements.define('x-x', class extends HTMLElement { |
+ constructor() { |
+ super(); |
+ reactions.push({ type: 'constructor', element: this }); |
+ } |
+ }); |
+ |
+ test(() => { |
+ assert_equals(reactions.length, 2); |
+ }, 'Upgrade elements in master and import'); |
+ |
+ let elementsInMaster = document.getElementsByTagName('x-x'); |
+ let elementsInImport = import1.import.getElementsByTagName('x-x'); |
+ test(() => { |
+ assert_equals(reactions[0].element, elementsInImport[0]); |
dominicc (has gone to gerrit)
2016/07/19 01:57:39
This test would be more descriptive if it had
<x-
|
+ assert_equals(reactions[1].element, elementsInMaster[0]); |
+ }, 'Upgrade elements in import first'); |
+ |
+ done(); |
+}; |
+</script> |