Bug 1334043 - Part 3: Update tests for connected callback.

Tag UXP Issue #1344
This commit is contained in:
Gaming4JC 2020-01-05 15:59:55 -05:00 committed by Roy Tam
commit b477c03089
7 changed files with 6 additions and 84 deletions

View file

@ -16,7 +16,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1102502
SimpleTest.waitForExplicitFinish();
var attachedCallbackCount = 0;
var connectedCallbackCount = 0;
var p = Object.create(HTMLElement.prototype);
@ -24,12 +24,12 @@ p.createdCallback = function() {
ok(true, "createdCallback called.");
};
p.attachedCallback = function() {
ok(true, "attachedCallback should be called when the parser creates an element in the document.");
attachedCallbackCount++;
// attachedCallback should be called twice, once for the element created for innerHTML and
p.connectedCallback = function() {
ok(true, "connectedCallback should be called when the parser creates an element in the document.");
connectedCallbackCount++;
// connectedCallback should be called twice, once for the element created for innerHTML and
// once for the element created in this document.
if (attachedCallbackCount == 2) {
if (connectedCallbackCount == 2) {
SimpleTest.finish();
}
}