Chromium Code Reviews| 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..cf6726f45ca5fd8f2ef6a859c9535446e2ba1f6c |
| --- /dev/null |
| +++ b/LayoutTests/fast/html/imports/import-custom-element-in-master-and-grandchild.html |
| @@ -0,0 +1,40 @@ |
| +<!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() { |
| + // FIXME(crbug.com/366877): Need another cycle to ensure microtasks are performed. |
| + setTimeout(function() { |
|
dominicc (has gone to gerrit)
2014/04/28 01:32:32
Do you do this everywhere? Maybe it makes sense to
Hajime Morrita
2014/04/29 23:11:37
Ok, done.
|
| + t1.step(function() { |
| + assert_array_equals(['hello-1', 'hello-2', 'hello-root-1', 'hello-root-2'], Hello.ids.slice(0).sort()); |
| + Hello.ids.splice(Hello.ids.indexOf('hello-2')); // Remove an asynchronously loaded element. |
| + assert_array_equals(['hello-root-1', 'hello-1', 'hello-root-2'], Hello.ids); |
| + t1.done(); |
| + }, 0); |
| + |
| + t2.step(function() { |
| + var Bye = registerTestingCustomElement('x-bye'); |
| + assert_array_equals(['bye-1', 'bye-2', 'bye-root-1', 'bye-root-2'], Bye.ids.slice(0).sort()); |
| + Bye.ids.splice(Bye.ids.indexOf('bye-2')); // Remove an asynchronously loaded element. |
| + assert_array_equals(['bye-root-1', 'bye-1', 'bye-root-2'], Bye.ids); |
| + t2.done(); |
| + }); |
| + }, 0); |
| +}, 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> |