summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/dom/idlharness.window.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /testing/web-platform/tests/dom/idlharness.window.js
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/dom/idlharness.window.js')
-rw-r--r--testing/web-platform/tests/dom/idlharness.window.js52
1 files changed, 52 insertions, 0 deletions
diff --git a/testing/web-platform/tests/dom/idlharness.window.js b/testing/web-platform/tests/dom/idlharness.window.js
new file mode 100644
index 0000000000..2c7bfd727e
--- /dev/null
+++ b/testing/web-platform/tests/dom/idlharness.window.js
@@ -0,0 +1,52 @@
+// META: script=/resources/WebIDLParser.js
+// META: script=/resources/idlharness.js
+// META: script=/common/subset-tests-by-key.js
+// META: variant=?include=Node
+// META: variant=?exclude=Node
+// META: timeout=long
+
+// Note: This isn't merged into idlharness.any.js because of the use of variants,
+// i.e., include=Node wouldn't make sense for workers.
+
+'use strict';
+
+idl_test(
+ ['dom', 'fullscreen'],
+ ['html'],
+ idl_array => {
+ self.xmlDoc = document.implementation.createDocument(null, '', null);
+ self.detachedRange = document.createRange();
+ detachedRange.detach();
+ self.element = xmlDoc.createElementNS(null, 'test');
+ element.setAttribute('bar', 'baz');
+
+ idl_array.add_objects({
+ EventTarget: ['new EventTarget()'],
+ Event: ['document.createEvent("Event")', 'new Event("foo")'],
+ CustomEvent: ['new CustomEvent("foo")'],
+ AbortController: ['new AbortController()'],
+ AbortSignal: ['new AbortController().signal'],
+ Document: ['new Document()'],
+ XMLDocument: ['xmlDoc'],
+ DOMImplementation: ['document.implementation'],
+ DocumentFragment: ['document.createDocumentFragment()'],
+ DocumentType: ['document.doctype'],
+ Element: ['element'],
+ Attr: ['document.querySelector("[id]").attributes[0]'],
+ Text: ['document.createTextNode("abc")'],
+ ProcessingInstruction: ['xmlDoc.createProcessingInstruction("abc", "def")'],
+ Comment: ['document.createComment("abc")'],
+ Range: ['document.createRange()', 'detachedRange'],
+ NodeIterator: ['document.createNodeIterator(document.body, NodeFilter.SHOW_ALL, null, false)'],
+ TreeWalker: ['document.createTreeWalker(document.body, NodeFilter.SHOW_ALL, null, false)'],
+ NodeList: ['document.querySelectorAll("script")'],
+ HTMLCollection: ['document.body.children'],
+ DOMTokenList: ['document.body.classList'],
+ XPathEvaluator: ['new XPathEvaluator()'],
+ XPathExpression: ['document.createExpression("//*")'],
+ XPathNSResolver: ['document.createNSResolver(document.body)'],
+ XPathResult: ['document.evaluate("//*", document.body)'],
+ XSLTProcessor: ['new XSLTProcessor()'],
+ });
+ }
+);