@webcomponents/custom-elements
Version:
HTML Custom Elements Polyfill
22 lines (19 loc) • 829 B
HTML
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../spec/resources/custom-elements-helpers.js"></script>
<link id="import1" rel="import" href="resources/async-component.html" async>
<a-a></a-a>
<script>;
promise_test(() => {
return customElements.whenDefined('a-a').then(() => {
let a = document.querySelector('a-a');
assert_is_upgraded(a, AsyncComponent,
'<async-component> in this document should have been upgraded.');
let b = import1.import.querySelector('a-a');
assert_is_upgraded(b, AsyncComponent,
'<async-component> in imported document should have been upgraded.');
});
}, 'custom elements definition in async import should work.');
</script>