1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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 = 3;
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>
|