diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/non-special-url-getter-setter.window.js | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/non-special-url-getter-setter.window.js')
-rw-r--r-- | testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/non-special-url-getter-setter.window.js | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/non-special-url-getter-setter.window.js b/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/non-special-url-getter-setter.window.js new file mode 100644 index 0000000000..de528a2f97 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/links/links-created-by-a-and-area-elements/non-special-url-getter-setter.window.js @@ -0,0 +1,63 @@ +[ + { + "property": "origin", + "get": "null", + "set": null + }, + { + "property": "protocol", + "get": "non-special:", + "set": "super-special", + "setget": "super-special:" + }, + { + "property": "username" + }, + { + "property": "password" + }, + { + "property": "host", + "get": "test:9001", + "setget": "string:9001" + }, + { + "property": "hostname", + "get": "test" + }, + { + "property": "port", + "get": "9001", + "set": "8000" + }, + { + "property": "pathname", + "get": "/", + "setget": "/string" + }, + { + "property": "search", + "setget": "?string" + }, + { + "property": "hash", + "setget": "#string" + } +].forEach(({ property, get = "", set = "string", setget = set }) => { + ["a", "area"].forEach(name => { + test(() => { + const link = document.createElement(name); + link.href = "non-special://test:9001/"; + assert_equals(link[property], get); + }, `<${name} href="non-special://test:9001/">.${property} getter`); + + if (set !== null) { + test(() => { + const link = document.createElement(name); + link.href = "non-special://test:9001/"; + link[property] = set; + assert_equals(link[property], setget); + }, `<${name} href="non-special://test:9001/">.${property} setter`); + } + }); +}); |