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

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

Issue 2132343002: Make Custom Elements V1 work in HTML imports documents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests Created 4 years, 5 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/imports-create.html
diff --git a/third_party/WebKit/LayoutTests/custom-elements/imports/imports-create.html b/third_party/WebKit/LayoutTests/custom-elements/imports/imports-create.html
new file mode 100644
index 0000000000000000000000000000000000000000..a96a018619c90995780f38c57535947bc56cc533
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/custom-elements/imports/imports-create.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+'use strict'
+setup({ explicit_done: true });
+let reactions = [];
+customElements.define('x-x', class extends HTMLElement {
+ constructor() {
+ super();
+ reactions.push({ type: 'constructor', element: this });
+ console.log("constructor", this);
+ }
+});
+test(() => {
+ assert_equals(reactions.length, 0);
+}, 'Should not have parsed <x-x> yet');
+</script>
+
+<x-x></x-x>
+
+<script>
+test(() => {
+ assert_equals(reactions.length, 1);
+}, 'Parser should create custom if after define');
+
+let import1 = document.createElement('link');
+import1.rel = 'import';
+import1.href = 'resources/import-custom.html';
+document.head.appendChild(import1);
+
+import1.onload = () => {
+ test(() => {
+ assert_equals(reactions.length, 2);
dominicc (has gone to gerrit) 2016/07/13 06:12:30 These presumably have to be in order. Can you push
kojii 2016/07/13 06:47:16 The test does push the actual object. Also the oth
kojii 2016/07/13 07:00:13 Done in PS5.
+ }, 'import should create custom if after define');
dominicc (has gone to gerrit) 2016/07/13 06:12:30 These descriptions are cryptic; what is create cus
+
+ done();
+};
+</script>

Powered by Google App Engine
This is Rietveld 408576698