Index: LayoutTests/http/tests/htmlimports/import-custom-element-order.html |
diff --git a/LayoutTests/http/tests/htmlimports/import-custom-element-order.html b/LayoutTests/http/tests/htmlimports/import-custom-element-order.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..00c93f8f9663cbdb2085bfba59471f79e616690c |
--- /dev/null |
+++ b/LayoutTests/http/tests/htmlimports/import-custom-element-order.html |
@@ -0,0 +1,37 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<script src="../../../resources/testharness.js"></script> |
+<script src="../../../resources/testharnessreport.js"></script> |
+<script src="resources/import-custom-element-helper.js"></script> |
+<script> |
+ |
+ |
+var Hello = registerTestingCustomElement('x-hello'); |
+var numberOfLinks = 2; |
+var t1 = async_test('Custom elements in async imports wait preceeding sync import before upgraded.'); |
+var t2 = async_test('Custom elements in async imports wait preceeding sync import before resolved.'); |
+ |
+var latch = new ImportTestLatch(function() { |
+ window.setTimeout(function() { |
+ t1.step(function() { |
+ assert_array_equals(['hello-slow', 'hello-1', 'hello-2'], Hello.ids); |
+ t1.done(); |
+ }); |
+ |
+ t2.step(function() { |
+ var Bye = registerTestingCustomElement('x-bye'); |
+ assert_array_equals(['bye-slow', 'bye-1', 'bye-2'], Bye.ids); |
+ t2.done(); |
+ }); |
+ }, 0); |
+}, numberOfLinks); |
+</script> |
+</head> |
+<body> |
+<link rel=import href="resources/import-slow-custom-element-hello.cgi" onload="latch.loaded()"> |
+<link rel=import async href="resources/import-custom-element-hello-1.html" onload="latch.loaded()"> |
+<x-hello id="hello-2"></x-hello> |
+<x-bye id="bye-2"></x-bye> |
+</body> |
+</html> |