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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/htmlimports/import-custom-element-order.html
diff --git a/LayoutTests/http/tests/htmlimports/import-custom-element-order.html b/LayoutTests/http/tests/htmlimports/import-custom-element-order.html
new file mode 100644
index 0000000000000000000000000000000000000000..e5b055b4aca25a30983e648663755695f7494b6b
--- /dev/null
+++ b/LayoutTests/http/tests/htmlimports/import-custom-element-order.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script>
+
+function registerTestingCustomElement(tagName) {
dominicc (has gone to gerrit) 2014/04/25 02:39:45 This looks similar to the one in import-custom-ele
+ var definition = function() {};
+ definition.ids = [];
+ definition.prototype = Object.create(HTMLElement.prototype);
+ definition.prototype.createdCallback = function() { definition.ids.push(this.id); }
+ document.registerElement(tagName, definition);
+ return definition;
+}
+
+var hello = registerTestingCustomElement('x-hello');
+var t1 = async_test('Custom element in async imports wait preceeding sync import before upgraded.');
+var t2 = async_test('Custom element in async imports wait preceeding sync import before resolved.');
+
+function ready()
+{
dominicc (has gone to gerrit) 2014/04/25 02:39:45 No newline
+ t1.step(function() {
+ assert_array_equals(['hello-slow', 'hello-2', 'hello-1'], hello.ids);
+ t1.done();
+ });
+
+ t2.step(function() {
+ var bye = registerTestingCustomElement('x-bye');
+ assert_array_equals(['bye-slow', 'bye-2', 'bye-1'], bye.ids);
+ t2.done();
+ });
+}
+</script>
+</head>
+<body>
+<link rel=import href="resources/import-slow-custom-element-hello.cgi">
+<link rel=import async href="resources/import-custom-element-hello-1.html" onload="ready()">
+<x-hello id="hello-2"></x-hello>
+<x-bye id="bye-2"></x-bye>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698