summaryrefslogtreecommitdiffstats
path: root/dom/tests/mochitest
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2020-01-19 21:22:39 -0500
committerGaming4JC <g4jc@hyperbola.info>2020-01-26 15:50:44 -0500
commita0014ac6e9e751f9f9bf68c1a345394bbcfd096f (patch)
tree6a7190495965549a03736feb6edc0b6a19e42da0 /dom/tests/mochitest
parentdd6749f7ddd4db014fb7d76a9b698d07f2b859f5 (diff)
downloadUXP-a0014ac6e9e751f9f9bf68c1a345394bbcfd096f.tar
UXP-a0014ac6e9e751f9f9bf68c1a345394bbcfd096f.tar.gz
UXP-a0014ac6e9e751f9f9bf68c1a345394bbcfd096f.tar.lz
UXP-a0014ac6e9e751f9f9bf68c1a345394bbcfd096f.tar.xz
UXP-a0014ac6e9e751f9f9bf68c1a345394bbcfd096f.zip
Bug 1378079 - Part 3: Complete the steps related to custom elements in "create an element for a token".
With fixup for missing header due to unified builds. Tag UXP Issue #1344
Diffstat (limited to 'dom/tests/mochitest')
-rw-r--r--dom/tests/mochitest/webcomponents/mochitest.ini3
-rw-r--r--dom/tests/mochitest/webcomponents/test_document_register_base_queue.html48
-rw-r--r--dom/tests/mochitest/webcomponents/test_document_register_parser.html4
3 files changed, 4 insertions, 51 deletions
diff --git a/dom/tests/mochitest/webcomponents/mochitest.ini b/dom/tests/mochitest/webcomponents/mochitest.ini
index e8f632e39..b32e9999e 100644
--- a/dom/tests/mochitest/webcomponents/mochitest.ini
+++ b/dom/tests/mochitest/webcomponents/mochitest.ini
@@ -10,6 +10,7 @@ support-files =
[test_content_element.html]
[test_custom_element_adopt_callbacks.html]
[test_custom_element_callback_innerhtml.html]
+skip-if = true # disabled - See bug 1390396
[test_custom_element_clone_callbacks_extended.html]
[test_custom_element_htmlconstructor.html]
skip-if = os == 'android' # bug 1323645
@@ -20,6 +21,7 @@ support-files =
[test_custom_element_in_shadow.html]
skip-if = true || stylo # disabled - See bug 1390396 and 1293844
[test_custom_element_register_invalid_callbacks.html]
+[test_custom_element_throw_on_dynamic_markup_insertion.html]
[test_custom_element_get.html]
[test_custom_element_when_defined.html]
[test_nested_content_element.html]
@@ -31,7 +33,6 @@ skip-if = true || stylo # disabled - See bug 1390396 and 1293844
[test_document_adoptnode.html]
[test_document_importnode.html]
[test_document_register.html]
-[test_document_register_base_queue.html]
[test_document_register_lifecycle.html]
skip-if = true # disabled - See bug 1390396
[test_document_register_parser.html]
diff --git a/dom/tests/mochitest/webcomponents/test_document_register_base_queue.html b/dom/tests/mochitest/webcomponents/test_document_register_base_queue.html
deleted file mode 100644
index c839857b4..000000000
--- a/dom/tests/mochitest/webcomponents/test_document_register_base_queue.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=783129
--->
-<head>
- <title>Test for document.registerElement lifecycle callback</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-<script>
-var p = Object.create(HTMLElement.prototype);
-
-var createdCallbackCallCount = 0;
-
-// By the time the base element queue is processed via the microtask,
-// both x-hello elements should be in the document.
-p.createdCallback = function() {
- var one = document.getElementById("one");
- var two = document.getElementById("two");
- isnot(one, null, "First x-hello element should be in the tree.");
- isnot(two, null, "Second x-hello element should be in the tree.");
- createdCallbackCallCount++;
- if (createdCallbackCallCount == 2) {
- SimpleTest.finish();
- }
-
- if (createdCallbackCallCount > 2) {
- ok(false, "Created callback called too much.");
- }
-};
-
-p.attributeChangedCallback = function(name, oldValue, newValue) {
- ok(false, "Attribute changed callback should not be called because callbacks should not be queued until created callback invoked.");
-};
-
-document.registerElement("x-hello", { prototype: p });
-
-SimpleTest.waitForExplicitFinish();
-</script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=783129">Bug 783129</a>
-<x-hello id="one"></x-hello>
-<x-hello id="two"></x-hello>
-<script>
-</script>
-</body>
-</html>
diff --git a/dom/tests/mochitest/webcomponents/test_document_register_parser.html b/dom/tests/mochitest/webcomponents/test_document_register_parser.html
index bc4cdcbac..a4fb63139 100644
--- a/dom/tests/mochitest/webcomponents/test_document_register_parser.html
+++ b/dom/tests/mochitest/webcomponents/test_document_register_parser.html
@@ -11,7 +11,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=783129
var extendedButtonProto = Object.create(HTMLButtonElement.prototype);
var buttonCallbackCalled = false;
-extendedButtonProto.createdCallback = function() {
+extendedButtonProto.connectedCallback = function() {
is(buttonCallbackCalled, false, "created callback for x-button should only be called once.");
is(this.tagName, "BUTTON", "Only the <button> element should be upgraded.");
buttonCallbackCalled = true;
@@ -21,7 +21,7 @@ document.registerElement("x-button", { prototype: extendedButtonProto, extends:
var divProto = Object.create(HTMLDivElement.prototype);
var divCallbackCalled = false;
-divProto.createdCallback = function() {
+divProto.connectedCallback = function() {
is(divCallbackCalled, false, "created callback for x-div should only be called once.");
is(buttonCallbackCalled, true, "crated callback should be called for x-button before x-div.");
is(this.tagName, "X-DIV", "Only the <x-div> element should be upgraded.");