Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Unified Diff: third_party/WebKit/LayoutTests/custom-elements/imports/async-imports.html

Issue 2242743002: Make custom elements work in HTML imports (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase wip Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/custom-elements/imports/async-imports.html
diff --git a/third_party/WebKit/LayoutTests/custom-elements/imports/async-imports.html b/third_party/WebKit/LayoutTests/custom-elements/imports/async-imports.html
new file mode 100644
index 0000000000000000000000000000000000000000..e5c405baa5dec06c0da9498389fb77f9c7c71b24
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/custom-elements/imports/async-imports.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<link rel="import" href="resources/async-component.html" async>
+<async-component></async-component>
+<script>
+'use strict';
+
+promise_test(() => {
+ return customElements.whenDefined('async-component').then(() => {
+ let el = document.querySelector('async-component');
+ assert_true(el instanceof AsyncComponent, 'async-component should be custom');
dominicc (has gone to gerrit) 2016/08/19 04:54:10 "be custom" is a bit vague; can you be more specif
kochi 2016/08/19 10:51:47 I rewrote where appropriate, but "be custom" is ok
+
+ let link = document.querySelector('link[rel=import]');
+ let elInImport = link.import.querySelector('async-component');
+ assert_true(elInImport instanceof AsyncComponent, 'async-component in import should be custom');
+ });
+}, 'Custom Elements v1 definition in async import should work.');
dominicc (has gone to gerrit) 2016/08/19 04:54:10 Just refer to these as "custom elements"; not "v1.
kochi 2016/08/19 10:51:47 Done.
+</script>

Powered by Google App Engine
This is Rietveld 408576698