Index: LayoutTests/fast/html/imports/import-custom-element-in-master-and-grandchild.html |
diff --git a/LayoutTests/fast/html/imports/import-custom-element-in-master-and-grandchild.html b/LayoutTests/fast/html/imports/import-custom-element-in-master-and-grandchild.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..efb62d89a809efdc9c2185a57e5d989e4db16edb |
--- /dev/null |
+++ b/LayoutTests/fast/html/imports/import-custom-element-in-master-and-grandchild.html |
@@ -0,0 +1,37 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<script src="../../../resources/testharness.js"></script> |
+<script src="../../../resources/testharnessreport.js"></script> |
+<script src="../../../http/tests/htmlimports/resources/import-custom-element-helper.js"></script> |
+</head> |
+<body> |
+<script> |
+var Hello = registerTestingCustomElement('x-hello'); |
+var numberOfLinks = 1; |
+var t1 = async_test('Custom elements in an indirect import and the master are both upgraded.'); |
+var t2 = async_test('Custom elements in an indirect import and the master are both resolved.'); |
+var latch = new ImportTestLatch(function() { |
+ t1.step(function() { |
+ assert_array_equals(Hello.ids.slice(0).sort(), ['hello-1', 'hello-2', 'hello-root-1', 'hello-root-2'], 'All custom elements are upgraded'); |
+ Hello.ids.splice(Hello.ids.indexOf('hello-2'), 1); // Remove an asynchronously loaded element. |
+ assert_array_equals(Hello.ids, ['hello-root-1', 'hello-1', 'hello-root-2'], 'The upgrade order follows imports'); |
+ t1.done(); |
+ }, 0); |
+ |
+ t2.step(function() { |
+ var Bye = registerTestingCustomElement('x-bye'); |
+ assert_array_equals(Bye.ids.slice(0).sort(), ['bye-1', 'bye-2', 'bye-root-1', 'bye-root-2'], 'All custom elements are upgraded'); |
+ Bye.ids.splice(Bye.ids.indexOf('bye-2'), 1); // Remove an asynchronously loaded element. |
+ assert_array_equals(Bye.ids, ['bye-root-1', 'bye-1', 'bye-root-2'], 'The upgrade order follows imports'); |
+ t2.done(); |
+ }); |
+}, numberOfLinks); |
+</script> |
+<x-hello id="hello-root-1"></x-hello> |
+<x-bye id="bye-root-1"></x-bye> |
+<link rel="import" href="resources/custom-element-hello-parent-12.html" onload="latch.loaded()"> |
+<x-hello id="hello-root-2"></x-hello> |
+<x-bye id="bye-root-2"></x-bye> |
+</body> |
+</html> |