From 43a97878ce14b72f0981164f87f2e35e14151312 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:22:09 +0200 Subject: Adding upstream version 110.0.1. Signed-off-by: Daniel Baumann --- testing/web-platform/tests/xhr/formdata/get.any.js | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 testing/web-platform/tests/xhr/formdata/get.any.js (limited to 'testing/web-platform/tests/xhr/formdata/get.any.js') diff --git a/testing/web-platform/tests/xhr/formdata/get.any.js b/testing/web-platform/tests/xhr/formdata/get.any.js new file mode 100644 index 0000000000..b307f1edd0 --- /dev/null +++ b/testing/web-platform/tests/xhr/formdata/get.any.js @@ -0,0 +1,28 @@ +// META: title=FormData: get and getAll + + test(function() { + assert_equals(create_formdata(['key', 'value1'], ['key', 'value2']).get('key'), "value1"); + }, 'testFormDataGet'); + test(function() { + assert_equals(create_formdata(['key', 'value1'], ['key', 'value2']).get('nil'), null); + }, 'testFormDataGetNull1'); + test(function() { + assert_equals(create_formdata().get('key'), null); + }, 'testFormDataGetNull2'); + test(function() { + assert_array_equals(create_formdata(['key', 'value1'], ['key', 'value2']).getAll('key'), ["value1", "value2"]); + }, 'testFormDataGetAll'); + test(function() { + assert_array_equals(create_formdata(['key', 'value1'], ['key', 'value2']).getAll('nil'), []); + }, 'testFormDataGetAllEmpty1'); + test(function() { + assert_array_equals(create_formdata().getAll('key'), []); + }, 'testFormDataGetAllEmpty2'); + + function create_formdata() { + var fd = new FormData(); + for (var i = 0; i < arguments.length; i++) { + fd.append.apply(fd, arguments[i]); + }; + return fd; + } -- cgit v1.2.3