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

Unified Diff: LayoutTests/http/tests/htmlimports/import-dup-custom-element.html

Issue 238923009: HTML Imports: No more BlockingDocumentCreation. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased to ToT. Created 6 years, 8 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: LayoutTests/http/tests/htmlimports/import-dup-custom-element.html
diff --git a/LayoutTests/http/tests/htmlimports/import-dup-custom-element.html b/LayoutTests/http/tests/htmlimports/import-dup-custom-element.html
new file mode 100644
index 0000000000000000000000000000000000000000..c956639bec201335651a471efe6f4805585e736f
--- /dev/null
+++ b/LayoutTests/http/tests/htmlimports/import-dup-custom-element.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script>
+var records = [];
+
+function addRecord(str)
+{
+ console.log(str);
+ records.push(str);
+}
+
+function recordElement(element)
+{
+ addRecord(element.tagName + ":" + element.id);
+}
+</script>
+<my-custom id="using-toplevel-1"></my-custom>
+<!--
+ |using-custom-element-1.html| reaches |def-custom-element.html| with one indirection
+ while |using-custom-element-2.html| imports it directly.
+ So |using-custom-element-2.html| triggers importing |def-custom-element.html| and
+ |using-custom-element-1.html| finds it and de-dups later.
+ -->
+<link rel="import" href="resources/using-custom-element-1.html">
+<link rel="import" href="resources/using-custom-element-2.html">
+<my-custom id="using-toplevel-2"></my-custom>
+</head>
+<body>
+<script>
+test(function () {
+ assert_array_equals(records, ['MY-CUSTOM:using-toplevel-1',
+ 'MY-CUSTOM:using-1-before',
+ 'MY-CUSTOM:pointing-before',
+ 'MY-CUSTOM:def-before',
+ 'MY-CUSTOM:def-after',
+ 'MY-CUSTOM:pointing-after',
+ 'MY-CUSTOM:using-1-after',
+ 'MY-CUSTOM:using-2-before',
+ 'MY-CUSTOM:using-2-after',
+ 'MY-CUSTOM:using-toplevel-2'],
+ 'Custom Element invocations preserve tree order across imports');
+}, 'Custom Element invocations preserve tree order across imports regardless the loading order.');
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698