diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/xhr/send-entity-body-get-head.htm | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.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/xhr/send-entity-body-get-head.htm')
-rw-r--r-- | testing/web-platform/tests/xhr/send-entity-body-get-head.htm | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/testing/web-platform/tests/xhr/send-entity-body-get-head.htm b/testing/web-platform/tests/xhr/send-entity-body-get-head.htm new file mode 100644 index 0000000000..95ff711b85 --- /dev/null +++ b/testing/web-platform/tests/xhr/send-entity-body-get-head.htm @@ -0,0 +1,36 @@ +<!doctype html> +<html> + <head> + <title>XMLHttpRequest: send() - non-empty data argument and GET/HEAD</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <link rel="help" href="https://xhr.spec.whatwg.org/#the-send()-method" data-tested-assertations="following::OL[1]/LI[3] following::OL[1]/LI[7]" /> + + </head> + <body> + <div id="log"></div> + <script> + function request(method) { + test(function() { + var events=[] + var logEvt = function (e) { + events.push(e.type) + } + var client = new XMLHttpRequest() + client.open(method, "resources/content.py", false) + client.send("TEST") + client.upload.addEventListener('progress', logEvt) + client.upload.addEventListener('loadend', logEvt) + client.upload.addEventListener('loadstart', logEvt) + + assert_equals(client.getResponseHeader("x-request-content-length"), "NO") + assert_equals(client.getResponseHeader("x-request-method"), method) + assert_equals(client.responseText, "") + assert_array_equals(events, []) + }, document.title + " (" + method + ")") + } + request("GET") + request("HEAD") + </script> + </body> +</html> |