summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/dom/nodes/DOMImplementation-createHTMLDocument.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/dom/nodes/DOMImplementation-createHTMLDocument.js
parentInitial commit. (diff)
downloadfirefox-upstream.tar.xz
firefox-upstream.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/dom/nodes/DOMImplementation-createHTMLDocument.js')
-rw-r--r--testing/web-platform/tests/dom/nodes/DOMImplementation-createHTMLDocument.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/testing/web-platform/tests/dom/nodes/DOMImplementation-createHTMLDocument.js b/testing/web-platform/tests/dom/nodes/DOMImplementation-createHTMLDocument.js
new file mode 100644
index 0000000000..3e7e9aa9b7
--- /dev/null
+++ b/testing/web-platform/tests/dom/nodes/DOMImplementation-createHTMLDocument.js
@@ -0,0 +1,25 @@
+function createHTMLDocuments(checkDoc) {
+ var tests = [
+ ["", "", ""],
+ [null, "null", "null"],
+ [undefined, undefined, ""],
+ ["foo bar baz", "foo bar baz", "foo bar baz"],
+ ["foo\t\tbar baz", "foo\t\tbar baz", "foo bar baz"],
+ ["foo\n\nbar baz", "foo\n\nbar baz", "foo bar baz"],
+ ["foo\f\fbar baz", "foo\f\fbar baz", "foo bar baz"],
+ ["foo\r\rbar baz", "foo\r\rbar baz", "foo bar baz"],
+ ]
+
+ tests.forEach(function(t, i) {
+ var title = t[0], expectedtitle = t[1], normalizedtitle = t[2]
+ test(function() {
+ var doc = document.implementation.createHTMLDocument(title);
+ checkDoc(doc, expectedtitle, normalizedtitle)
+ }, "createHTMLDocument test " + i + ": " + t.map(function(el) { return format_value(el) }))
+ })
+
+ test(function() {
+ var doc = document.implementation.createHTMLDocument();
+ checkDoc(doc, undefined, "")
+ }, "Missing title argument");
+}