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

Unified Diff: LayoutTests/fast/dom/custom/callbacks-parsing.html

Issue 17707002: Implement Custom Elements inserted and removed callbacks. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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/fast/dom/custom/callbacks-parsing.html
diff --git a/LayoutTests/fast/dom/custom/callbacks-parsing.html b/LayoutTests/fast/dom/custom/callbacks-parsing.html
new file mode 100644
index 0000000000000000000000000000000000000000..318b0db81f03fcae8396ee64a34b958d7701323f
--- /dev/null
+++ b/LayoutTests/fast/dom/custom/callbacks-parsing.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<body>
+<script>
+t = async_test('parsing callbacks');
+t.calls = [];
+
+t.step(function () {
+ var proto = Object.create(HTMLElement.prototype);
+ proto.readyCallback = function () {
+ t.calls.push(this.id + ' ready');
+ };
+ proto.insertedCallback = function () {
+ t.calls.push(this.id + ' inserted');
+ };
+
+ var ctor = document.register('x-a', {prototype: proto});
+});
+</script>
+<x-a id="a"></x-a>
+<x-a id="b"></x-a>
+<x-a id="c"></x-a>
+<script>
+t.step(function () {
+ assert_array_equals(t.calls, ['c ready', 'b ready', 'a ready', 'a inserted', 'b inserted', 'c inserted'], 'the callbacks should have been invoked at microtask checkpoint');
+ t.done();
+ t = null;
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698