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..e5b055b4aca25a30983e648663755695f7494b6b |
--- /dev/null |
+++ b/LayoutTests/http/tests/htmlimports/import-custom-element-order.html |
@@ -0,0 +1,42 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<script src="../../../resources/testharness.js"></script> |
+<script src="../../../resources/testharnessreport.js"></script> |
+<script> |
+ |
+function registerTestingCustomElement(tagName) { |
dominicc (has gone to gerrit)
2014/04/25 02:39:45
This looks similar to the one in import-custom-ele
|
+ var definition = function() {}; |
+ definition.ids = []; |
+ definition.prototype = Object.create(HTMLElement.prototype); |
+ definition.prototype.createdCallback = function() { definition.ids.push(this.id); } |
+ document.registerElement(tagName, definition); |
+ return definition; |
+} |
+ |
+var hello = registerTestingCustomElement('x-hello'); |
+var t1 = async_test('Custom element in async imports wait preceeding sync import before upgraded.'); |
+var t2 = async_test('Custom element in async imports wait preceeding sync import before resolved.'); |
+ |
+function ready() |
+{ |
dominicc (has gone to gerrit)
2014/04/25 02:39:45
No newline
|
+ t1.step(function() { |
+ assert_array_equals(['hello-slow', 'hello-2', 'hello-1'], hello.ids); |
+ t1.done(); |
+ }); |
+ |
+ t2.step(function() { |
+ var bye = registerTestingCustomElement('x-bye'); |
+ assert_array_equals(['bye-slow', 'bye-2', 'bye-1'], bye.ids); |
+ t2.done(); |
+ }); |
+} |
+</script> |
+</head> |
+<body> |
+<link rel=import href="resources/import-slow-custom-element-hello.cgi"> |
+<link rel=import async href="resources/import-custom-element-hello-1.html" onload="ready()"> |
+<x-hello id="hello-2"></x-hello> |
+<x-bye id="bye-2"></x-bye> |
+</body> |
+</html> |