From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../tests/xhr/send-data-arraybuffer.any.js | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 testing/web-platform/tests/xhr/send-data-arraybuffer.any.js (limited to 'testing/web-platform/tests/xhr/send-data-arraybuffer.any.js') diff --git a/testing/web-platform/tests/xhr/send-data-arraybuffer.any.js b/testing/web-platform/tests/xhr/send-data-arraybuffer.any.js new file mode 100644 index 0000000000..71933d0897 --- /dev/null +++ b/testing/web-platform/tests/xhr/send-data-arraybuffer.any.js @@ -0,0 +1,31 @@ +// META: title=XMLHttpRequest.send(arraybuffer) + +var test = async_test(); +test.step(function() +{ + var xhr = new XMLHttpRequest(); + var buf = new ArrayBuffer(5); + var arr = new Uint8Array(buf); + arr[0] = 0x48; + arr[1] = 0x65; + arr[2] = 0x6c; + arr[3] = 0x6c; + arr[4] = 0x6f; + + xhr.onreadystatechange = function() + { + if (xhr.readyState == 4) + { + test.step(function() + { + assert_equals(xhr.status, 200); + assert_equals(xhr.response, "Hello"); + + test.done(); + }); + } + }; + + xhr.open("POST", "./resources/content.py", true); + xhr.send(buf); +}); -- cgit v1.2.3