diff options
author | athenian200 <athenian200@outlook.com> | 2020-01-27 22:59:08 -0600 |
---|---|---|
committer | athenian200 <athenian200@outlook.com> | 2020-01-27 22:59:08 -0600 |
commit | 3c4f414db74b84f7d2a6fb13fd888a47a153699b (patch) | |
tree | ea81fca559849967a79d598a6f460830762ec9ea /dom/base/test/chrome/test_registerElement_content.xul | |
parent | 1f8d508258ac5d7d57fc4eb35cac90f28bc8ca03 (diff) | |
parent | c4b0715baaffc541670fd1158557aa7e61e521d3 (diff) | |
download | UXP-3c4f414db74b84f7d2a6fb13fd888a47a153699b.tar UXP-3c4f414db74b84f7d2a6fb13fd888a47a153699b.tar.gz UXP-3c4f414db74b84f7d2a6fb13fd888a47a153699b.tar.lz UXP-3c4f414db74b84f7d2a6fb13fd888a47a153699b.tar.xz UXP-3c4f414db74b84f7d2a6fb13fd888a47a153699b.zip |
Merge branch 'master' of https://github.com/MoonchildProductions/UXP into form-disabled-issue
Diffstat (limited to 'dom/base/test/chrome/test_registerElement_content.xul')
-rw-r--r-- | dom/base/test/chrome/test_registerElement_content.xul | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/dom/base/test/chrome/test_registerElement_content.xul b/dom/base/test/chrome/test_registerElement_content.xul index 9a918f2d7..bf00ed53d 100644 --- a/dom/base/test/chrome/test_registerElement_content.xul +++ b/dom/base/test/chrome/test_registerElement_content.xul @@ -21,19 +21,13 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1130028 <script type="application/javascript"><![CDATA[ /** Test for Bug 1130028 **/ - SimpleTest.waitForExplicitFinish(); + var connectedCallbackCount = 0; - var createdCallbackCount = 0; - - // Callback should be called once by element created in chrome, - // and once by element created in content. - function createdCallbackCalled() { - createdCallbackCount++; - ok(true, "Created callback called, should be called twice in test."); + // Callback should be called only once by element created in content. + function connectedCallbackCalled() { + connectedCallbackCount++; + is(connectedCallbackCount, 1, "Connected callback called, should be called once in test."); is(this.magicNumber, 42, "Callback should be able to see the custom prototype."); - if (createdCallbackCount == 2) { - SimpleTest.finish(); - } } function startTests() { @@ -45,10 +39,13 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1130028 var proto = Object.create(frame.contentWindow.HTMLElement.prototype); proto.magicNumber = 42; - proto.createdCallback = createdCallbackCalled; + proto.connectedCallback = connectedCallbackCalled; + frame.contentDocument.registerElement("x-bar", { prototype: proto }); + is(connectedCallbackCount, 1, "Connected callback should be called by element created in content."); - frame.contentDocument.createElement("x-bar"); + var element = frame.contentDocument.createElement("x-bar"); + is(element.magicNumber, 42, "Should be able to see the custom prototype on created element."); } ]]></script> |