Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Side by Side Diff: LayoutTests/fast/html/imports/import-custom-element-async-resolve.html

Issue 249563003: REGRESSION(r171966): Custom elements in async imports don't get upgrade. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../resources/testharness.js"></script>
5 <script src="../../../resources/testharnessreport.js"></script>
6 <script src="../../../http/tests/htmlimports/resources/import-custom-element-hel per.js"></script>
7 </head>
8 <body>
9 <script>
10 var Hello = registerTestingCustomElement('x-hello');
11
12 var t1 = async_test('Instantiate custom elements in async imports.');
13 var t2 = async_test('Resolve custom elements in async imports later.');
14 var numberOfLinks = 6;
15 var latch = new ImportTestLatch(function() {
16 t1.step(function() {
17 assert_equals('hello-1', Hello.ids[0]);
18 assert_array_equals(['hello-2', 'hello-3', 'hello-4', 'hello-5', 'hello- 6', 'hello-7', 'hello-8', 'hello-p34-1', 'hello-p34-2', 'hello-p56-1', 'hello-p5 6-2'],
19 Hello.ids.slice(1).sort());
20
21 assert_true(Hello.ids.indexOf('hello-p34-1') < Hello.ids.indexOf('hello- 3'));
22 assert_true(Hello.ids.indexOf('hello-3') < Hello.ids.indexOf('hello-p34- 2'));
23 assert_true(Hello.ids.indexOf('hello-3') < Hello.ids.indexOf('hello-7')) ;
24
25 // Even though parent-2 is loaded in async, its content should follow th e order.
26 assert_true(Hello.ids.indexOf('hello-p56-1') < Hello.ids.indexOf('hello- 5'));
27 assert_true(Hello.ids.indexOf('hello-5') < Hello.ids.indexOf('hello-p56- 2'));
28
29 t1.done();
30 });
31
32 t2.step(function() {
33 var Bye = registerTestingCustomElement('x-bye');
34
35 assert_equals('bye-1', Bye.ids[0]);
36 assert_array_equals(['bye-2', 'bye-3', 'bye-4', 'bye-5', 'bye-6', 'bye-7 ', 'bye-8', 'bye-p34-1', 'bye-p34-2', 'bye-p56-1', 'bye-p56-2'],
37 Bye.ids.slice(1).sort());
38 assert_true(Bye.ids.indexOf('bye-p34-1') < Bye.ids.indexOf('bye-3'));
39 assert_true(Bye.ids.indexOf('bye-3') < Bye.ids.indexOf('bye-p34-2'));
40 assert_true(Bye.ids.indexOf('bye-3') < Bye.ids.indexOf('bye-7'));
41 assert_true(Bye.ids.indexOf('bye-p56-1') < Bye.ids.indexOf('bye-5'));
42 assert_true(Bye.ids.indexOf('bye-5') < Bye.ids.indexOf('bye-p56-2'));
43
44 t2.done();
45 });
46 }, numberOfLinks);
47 </script>
48 <link rel="import" href="resources/custom-element-hello-1.html" onload="latch.lo aded()">
49 <link rel="import" href="resources/custom-element-hello-2.html" async onload="la tch.loaded()">
50 <link rel="import" href="resources/custom-element-hello-parent-34.html" onload=" latch.loaded()">
51 <link rel="import" href="resources/custom-element-hello-parent-56.html" async on load="latch.loaded()">
52 <link rel="import" href="resources/custom-element-hello-7.html" onload="latch.lo aded()">
53 <script>
54 (function() {
55 var link = document.createElement('link');
56 link.href = 'resources/custom-element-hello-8.html';
57 link.rel = 'import';
58 link.onload = latch.loaded.bind(latch);
59 document.head.appendChild(link);
60 })();
61 </script>
62 </body>
63 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698