summaryrefslogtreecommitdiffstats
path: root/dom/tests/mochitest
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2020-01-20 19:49:20 -0500
committerGaming4JC <g4jc@hyperbola.info>2020-01-26 15:50:48 -0500
commitf576d8f0fe2a2203e6ad5fdd1a319b8991322756 (patch)
treef483b62147c74b621e4f2032f31bee2c9cae5a84 /dom/tests/mochitest
parent37d09da24e6c97e3f05ad344893f9b9513ba58ff (diff)
downloadUXP-f576d8f0fe2a2203e6ad5fdd1a319b8991322756.tar
UXP-f576d8f0fe2a2203e6ad5fdd1a319b8991322756.tar.gz
UXP-f576d8f0fe2a2203e6ad5fdd1a319b8991322756.tar.lz
UXP-f576d8f0fe2a2203e6ad5fdd1a319b8991322756.tar.xz
UXP-f576d8f0fe2a2203e6ad5fdd1a319b8991322756.zip
Bug 1396620 - Part 1: Remove created callback for custom elements
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_custom_element_adopt_callbacks.html29
-rw-r--r--dom/tests/mochitest/webcomponents/test_custom_element_clone_callbacks_extended.html40
-rw-r--r--dom/tests/mochitest/webcomponents/test_custom_element_import_node_created_callback.html34
-rw-r--r--dom/tests/mochitest/webcomponents/test_custom_element_register_invalid_callbacks.html1
-rw-r--r--dom/tests/mochitest/webcomponents/test_document_shared_registry.html33
6 files changed, 0 insertions, 140 deletions
diff --git a/dom/tests/mochitest/webcomponents/mochitest.ini b/dom/tests/mochitest/webcomponents/mochitest.ini
index b32e9999e..3559f33c1 100644
--- a/dom/tests/mochitest/webcomponents/mochitest.ini
+++ b/dom/tests/mochitest/webcomponents/mochitest.ini
@@ -8,16 +8,13 @@ support-files =
[test_bug1176757.html]
[test_bug1276240.html]
[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
support-files =
htmlconstructor_autonomous_tests.js
htmlconstructor_builtin_tests.js
-[test_custom_element_import_node_created_callback.html]
[test_custom_element_in_shadow.html]
skip-if = true || stylo # disabled - See bug 1390396 and 1293844
[test_custom_element_register_invalid_callbacks.html]
diff --git a/dom/tests/mochitest/webcomponents/test_custom_element_adopt_callbacks.html b/dom/tests/mochitest/webcomponents/test_custom_element_adopt_callbacks.html
deleted file mode 100644
index 28597b7c6..000000000
--- a/dom/tests/mochitest/webcomponents/test_custom_element_adopt_callbacks.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1081039
--->
-<head>
- <title>Test callbacks for adopted custom elements.</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<template id="template"><x-foo></x-foo></template>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1081039">Bug 1081039</a>
-<script>
-
-var p = Object.create(HTMLElement.prototype);
-p.createdCallback = function() {
- ok(false, "Created callback should not be called for adopted node.");
-};
-
-document.registerElement("x-foo", { prototype: p });
-
-var template = document.getElementById("template");
-var adoptedFoo = document.adoptNode(template.content.firstChild);
-is(adoptedFoo.nodeName, "X-FOO");
-
-</script>
-</body>
-</html>
diff --git a/dom/tests/mochitest/webcomponents/test_custom_element_clone_callbacks_extended.html b/dom/tests/mochitest/webcomponents/test_custom_element_clone_callbacks_extended.html
deleted file mode 100644
index b3531b0ea..000000000
--- a/dom/tests/mochitest/webcomponents/test_custom_element_clone_callbacks_extended.html
+++ /dev/null
@@ -1,40 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1081039
--->
-<head>
- <title>Test callbacks for cloned extended custom elements.</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1081039">Bug 1081039</a>
-<script>
-
-SimpleTest.waitForExplicitFinish();
-
-// Test to make sure created callback is called on clones created after
-// registering the custom element.
-
-var count = 0;
-var p = Object.create(HTMLButtonElement.prototype);
-p.createdCallback = function() { // should be called by createElement and cloneNode
- is(this.__proto__, p, "Correct prototype should be set on custom elements.");
-
- if (++count == 2) {
- SimpleTest.finish();
- }
-};
-
-document.registerElement("x-foo", { prototype: p, extends: "button" });
-var foo = document.createElement("button", {is: "x-foo"});
-is(foo.getAttribute("is"), "x-foo");
-
-var fooClone = foo.cloneNode(true);
-
-SimpleTest.waitForExplicitFinish();
-
-</script>
-</body>
-</html>
diff --git a/dom/tests/mochitest/webcomponents/test_custom_element_import_node_created_callback.html b/dom/tests/mochitest/webcomponents/test_custom_element_import_node_created_callback.html
deleted file mode 100644
index f533b507c..000000000
--- a/dom/tests/mochitest/webcomponents/test_custom_element_import_node_created_callback.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1093680
--->
-<head>
- <title>Test created callback order for imported custom element.</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<template id="template"><x-foo><span></span></x-foo></template>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1093680">Bug 1093680</a>
-<script>
-
-var fooProtoCreatedCallbackCalled = false;
-var fooProto = Object.create(HTMLElement.prototype);
-fooProto.createdCallback = function() {
- ok(this.firstElementChild, "When the created callback is called, the element should already have a child because the callback should only be called after cloning all the contents.");
- fooProtoCreatedCallbackCalled = true;
-};
-
-document.registerElement("x-foo", { prototype: fooProto });
-
-var template = document.getElementById("template");
-
-// Importing node will implicityly clone the conent in the main document.
-var adoptedFoo = document.importNode(template.content, true);
-
-ok(fooProtoCreatedCallbackCalled, "Created callback should be called after importing custom element into document");
-
-</script>
-</body>
-</html>
diff --git a/dom/tests/mochitest/webcomponents/test_custom_element_register_invalid_callbacks.html b/dom/tests/mochitest/webcomponents/test_custom_element_register_invalid_callbacks.html
index d1b1b1e04..572579ba8 100644
--- a/dom/tests/mochitest/webcomponents/test_custom_element_register_invalid_callbacks.html
+++ b/dom/tests/mochitest/webcomponents/test_custom_element_register_invalid_callbacks.html
@@ -19,7 +19,6 @@ const testWindow = iframe.contentDocument.defaultView;
// This is for backward compatibility.
// We should do the same checks for the callbacks from v0 spec.
[
- 'createdCallback',
'attributeChangedCallback',
].forEach(callback => {
var c = class {};
diff --git a/dom/tests/mochitest/webcomponents/test_document_shared_registry.html b/dom/tests/mochitest/webcomponents/test_document_shared_registry.html
index 76c2ea8ec..db72e1e6c 100644
--- a/dom/tests/mochitest/webcomponents/test_document_shared_registry.html
+++ b/dom/tests/mochitest/webcomponents/test_document_shared_registry.html
@@ -14,37 +14,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=783129
<script>
var container = document.getElementById("container");
-function createdCallbackFromMainDoc() {
- var createdCallbackCalled = false;
- var assocDoc = document.implementation.createHTMLDocument();
-
- var proto = Object.create(HTMLElement.prototype);
- proto.createdCallback = function() {
- is(createdCallbackCalled, false, "created callback should only be called once in this tests.");
- createdCallbackCalled = true;
- runNextTest();
- };
-
- assocDoc.registerElement("x-associated-doc-callback-elem", { prototype: proto });
- document.createElement("x-associated-doc-callback-elem");
-}
-
-function createdCallbackFromDocHTMLNamespace() {
- var createdCallbackCalled = false;
- var assocDoc = document.implementation.createDocument("http://www.w3.org/1999/xhtml", "html", null);
- var somediv = assocDoc.createElement("div");
-
- var proto = Object.create(HTMLElement.prototype);
- proto.createdCallback = function() {
- is(createdCallbackCalled, false, "created callback should only be called once in this tests.");
- createdCallbackCalled = true;
- runNextTest();
- };
-
- assocDoc.registerElement("x-assoc-doc-with-ns-callback-elem", { prototype: proto });
- document.createElement("x-assoc-doc-with-ns-callback-elem");
-}
-
function registerNoRegistryDoc() {
var assocDoc = document.implementation.createDocument(null, "html");
try {
@@ -65,8 +34,6 @@ function runNextTest() {
}
var testFunctions = [
- createdCallbackFromMainDoc,
- createdCallbackFromDocHTMLNamespace,
registerNoRegistryDoc,
SimpleTest.finish
];