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

Unified Diff: LayoutTests/fast/dom/custom/callback-timing.html

Issue 839673004: Test that custom element callback fires before DOMContentLoaded event. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 11 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
« no previous file with comments | « no previous file | LayoutTests/fast/dom/custom/callback-timing-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/custom/callback-timing.html
diff --git a/LayoutTests/fast/dom/custom/callback-timing.html b/LayoutTests/fast/dom/custom/callback-timing.html
new file mode 100644
index 0000000000000000000000000000000000000000..f778f5e91560def58deba888e8967ed9627e31c6
--- /dev/null
+++ b/LayoutTests/fast/dom/custom/callback-timing.html
@@ -0,0 +1,23 @@
+<script src='../../../resources/js-test.js'></script>
+<x-foo></x-foo>
+<script>
+description('Ensure that custom element callback fires before DOMContentLoaded event');
+
+var eventlog = [];
+
+addEventListener('DOMContentLoaded', function(e) {
+ eventlog.push('DOMContentLoaded event');
+});
+addEventListener('load', function(e) {
+ eventlog.push('load event');
+
+ shouldBe("eventlog[0]", "'created x-foo'");
+ shouldBe("eventlog[1]", "'DOMContentLoaded event'");
+ shouldBe("eventlog[2]", "'load event'");
+});
+var proto = Object.create(HTMLElement.prototype);
+proto.createdCallback = function() {
+ eventlog.push('created ' + this.localName);
+};
+document.registerElement('x-foo', {prototype: proto});
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/custom/callback-timing-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698