Chromium Code Reviews| Index: LayoutTests/fast/html/imports/import-custom-element-dup-resolve.html |
| diff --git a/LayoutTests/fast/html/imports/import-custom-element-dup-resolve.html b/LayoutTests/fast/html/imports/import-custom-element-dup-resolve.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bbd89c79059e8a1cb4cfc66a10149ca5b7d3e73d |
| --- /dev/null |
| +++ b/LayoutTests/fast/html/imports/import-custom-element-dup-resolve.html |
| @@ -0,0 +1,43 @@ |
| +<!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> |
| +</head> |
| +<body> |
| +<script> |
| +var hello = registerTestingCustomElement('x-hello'); |
| + |
| +var t1 = async_test('Instantiate custom elements in async imports.'); |
| +var t2 = async_test('Resolve custom elements in async imports later.'); |
| +var latch = new ImportTestLatch(function() { |
| + // FIXME(crbug.com/366877): Need another cycle to ensure microtasks are performed. |
| + setTimeout(function() { |
| + t1.step(function() { |
| + assert_array_equals(['hello-3', 'hello-4', 'hello-5', 'hello-6', 'hello-p34-1', 'hello-p34-2', 'hello-p56-1', 'hello-p56-2'], hello.ids.slice(0).sort(), "All elements are upgraded only once"); |
| + hello.ids.splice(hello.ids.indexOf('hello-4'), 1); |
|
dominicc (has gone to gerrit)
2014/04/25 02:39:45
I think this needs a comment, maybe some whitespac
|
| + hello.ids.splice(hello.ids.indexOf('hello-6'), 1); |
| + assert_array_equals(['hello-p34-1', 'hello-3', 'hello-p34-2', 'hello-5', 'hello-p56-1', 'hello-p56-2'], hello.ids, "Elements from non async improts are upgraded in order"); |
| + t1.done(); |
| + }); |
| + |
| + t2.step(function() { |
| + var bye = registerTestingCustomElement('x-bye'); |
| + assert_array_equals(['bye-3', 'bye-4', 'bye-5', 'bye-6', 'bye-p34-1', 'bye-p34-2', 'bye-p56-1', 'bye-p56-2'], bye.ids.slice(0).sort(), "All elements are upgraded only once"); |
|
dominicc (has gone to gerrit)
2014/04/25 02:39:45
Again, ' vs "
|
| + bye.ids.splice(bye.ids.indexOf('bye-4'), 1); |
| + bye.ids.splice(bye.ids.indexOf('bye-6'), 1); |
| + assert_array_equals(['bye-p34-1', 'bye-3', 'bye-p34-2', 'bye-5', 'bye-p56-1', 'bye-p56-2'], bye.ids, "Elements from non async improts are upgraded in order"); |
| + t2.done(); |
| + }); |
| + }, 0); |
| +}, 6); |
| +</script> |
| +<link rel="import" href="resources/custom-element-hello-parent-34.html" onload="latch.loaded()"> |
| +<link rel="import" href="resources/custom-element-hello-3.html" onload="latch.loaded()"> |
| +<link rel="import" href="resources/custom-element-hello-4.html" async onload="latch.loaded()"> |
| +<link rel="import" href="resources/custom-element-hello-5.html" onload="latch.loaded()"> |
| +<link rel="import" href="resources/custom-element-hello-6.html" async onload="latch.loaded()"> |
| +<link rel="import" href="resources/custom-element-hello-parent-56.html" onload="latch.loaded()"> |
| +</body> |
| +</html> |