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

Side by Side Diff: LayoutTests/http/tests/htmlimports/import-custom-element-order.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: Added and revised tests Created 6 years, 8 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>
7
8 function registerTestingCustomElement(tagName) {
dominicc (has gone to gerrit) 2014/04/25 02:39:45 This looks similar to the one in import-custom-ele
9 var definition = function() {};
10 definition.ids = [];
11 definition.prototype = Object.create(HTMLElement.prototype);
12 definition.prototype.createdCallback = function() { definition.ids.push(this .id); }
13 document.registerElement(tagName, definition);
14 return definition;
15 }
16
17 var hello = registerTestingCustomElement('x-hello');
18 var t1 = async_test('Custom element in async imports wait preceeding sync import before upgraded.');
19 var t2 = async_test('Custom element in async imports wait preceeding sync import before resolved.');
20
21 function ready()
22 {
dominicc (has gone to gerrit) 2014/04/25 02:39:45 No newline
23 t1.step(function() {
24 assert_array_equals(['hello-slow', 'hello-2', 'hello-1'], hello.ids);
25 t1.done();
26 });
27
28 t2.step(function() {
29 var bye = registerTestingCustomElement('x-bye');
30 assert_array_equals(['bye-slow', 'bye-2', 'bye-1'], bye.ids);
31 t2.done();
32 });
33 }
34 </script>
35 </head>
36 <body>
37 <link rel=import href="resources/import-slow-custom-element-hello.cgi">
38 <link rel=import async href="resources/import-custom-element-hello-1.html" onloa d="ready()">
39 <x-hello id="hello-2"></x-hello>
40 <x-bye id="bye-2"></x-bye>
41 </body>
42 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698