11cb0ef41Sopenharmony_ci[
21cb0ef41Sopenharmony_ci  { "input": "test", "output": [["test", ""]] },
31cb0ef41Sopenharmony_ci  { "input": "\uFEFFtest=\uFEFF", "output": [["\uFEFFtest", "\uFEFF"]] },
41cb0ef41Sopenharmony_ci  { "input": "%EF%BB%BFtest=%EF%BB%BF", "output": [["\uFEFFtest", "\uFEFF"]] },
51cb0ef41Sopenharmony_ci  { "input": "%EF%BF%BF=%EF%BF%BF", "output": [["\uFFFF", "\uFFFF"]] },
61cb0ef41Sopenharmony_ci  { "input": "%FE%FF", "output": [["\uFFFD\uFFFD", ""]] },
71cb0ef41Sopenharmony_ci  { "input": "%FF%FE", "output": [["\uFFFD\uFFFD", ""]] },
81cb0ef41Sopenharmony_ci  { "input": "†&†=x", "output": [["†", ""], ["†", "x"]] },
91cb0ef41Sopenharmony_ci  { "input": "%C2", "output": [["\uFFFD", ""]] },
101cb0ef41Sopenharmony_ci  { "input": "%C2x", "output": [["\uFFFDx", ""]] },
111cb0ef41Sopenharmony_ci  { "input": "_charset_=windows-1252&test=%C2x", "output": [["_charset_", "windows-1252"], ["test", "\uFFFDx"]] },
121cb0ef41Sopenharmony_ci  { "input": '', "output": [] },
131cb0ef41Sopenharmony_ci  { "input": 'a', "output": [['a', '']] },
141cb0ef41Sopenharmony_ci  { "input": 'a=b', "output": [['a', 'b']] },
151cb0ef41Sopenharmony_ci  { "input": 'a=', "output": [['a', '']] },
161cb0ef41Sopenharmony_ci  { "input": '=b', "output": [['', 'b']] },
171cb0ef41Sopenharmony_ci  { "input": '&', "output": [] },
181cb0ef41Sopenharmony_ci  { "input": '&a', "output": [['a', '']] },
191cb0ef41Sopenharmony_ci  { "input": 'a&', "output": [['a', '']] },
201cb0ef41Sopenharmony_ci  { "input": 'a&a', "output": [['a', ''], ['a', '']] },
211cb0ef41Sopenharmony_ci  { "input": 'a&b&c', "output": [['a', ''], ['b', ''], ['c', '']] },
221cb0ef41Sopenharmony_ci  { "input": 'a=b&c=d', "output": [['a', 'b'], ['c', 'd']] },
231cb0ef41Sopenharmony_ci  { "input": 'a=b&c=d&', "output": [['a', 'b'], ['c', 'd']] },
241cb0ef41Sopenharmony_ci  { "input": '&&&a=b&&&&c=d&', "output": [['a', 'b'], ['c', 'd']] },
251cb0ef41Sopenharmony_ci  { "input": 'a=a&a=b&a=c', "output": [['a', 'a'], ['a', 'b'], ['a', 'c']] },
261cb0ef41Sopenharmony_ci  { "input": 'a==a', "output": [['a', '=a']] },
271cb0ef41Sopenharmony_ci  { "input": 'a=a+b+c+d', "output": [['a', 'a b c d']] },
281cb0ef41Sopenharmony_ci  { "input": '%=a', "output": [['%', 'a']] },
291cb0ef41Sopenharmony_ci  { "input": '%a=a', "output": [['%a', 'a']] },
301cb0ef41Sopenharmony_ci  { "input": '%a_=a', "output": [['%a_', 'a']] },
311cb0ef41Sopenharmony_ci  { "input": '%61=a', "output": [['a', 'a']] },
321cb0ef41Sopenharmony_ci  { "input": '%61+%4d%4D=', "output": [['a MM', '']] },
331cb0ef41Sopenharmony_ci  { "input": "id=0&value=%", "output": [['id', '0'], ['value', '%']] },
341cb0ef41Sopenharmony_ci  { "input": "b=%2sf%2a", "output": [['b', '%2sf*']]},
351cb0ef41Sopenharmony_ci  { "input": "b=%2%2af%2a", "output": [['b', '%2*f*']]},
361cb0ef41Sopenharmony_ci  { "input": "b=%%2a", "output": [['b', '%*']]}
371cb0ef41Sopenharmony_ci].forEach((val) => {
381cb0ef41Sopenharmony_ci  test(() => {
391cb0ef41Sopenharmony_ci    let sp = new URLSearchParams(val.input),
401cb0ef41Sopenharmony_ci        i = 0
411cb0ef41Sopenharmony_ci    for (let item of sp) {
421cb0ef41Sopenharmony_ci       assert_array_equals(item, val.output[i])
431cb0ef41Sopenharmony_ci       i++
441cb0ef41Sopenharmony_ci    }
451cb0ef41Sopenharmony_ci  }, "URLSearchParams constructed with: " + val.input)
461cb0ef41Sopenharmony_ci
471cb0ef41Sopenharmony_ci  promise_test(() => {
481cb0ef41Sopenharmony_ci    let init = new Request("about:blank", { body: val.input, method: "LADIDA", headers: {"Content-Type": "application/x-www-form-urlencoded;charset=windows-1252"} }).formData()
491cb0ef41Sopenharmony_ci    return init.then((fd) => {
501cb0ef41Sopenharmony_ci      let i = 0
511cb0ef41Sopenharmony_ci      for (let item of fd) {
521cb0ef41Sopenharmony_ci         assert_array_equals(item, val.output[i])
531cb0ef41Sopenharmony_ci         i++
541cb0ef41Sopenharmony_ci      }
551cb0ef41Sopenharmony_ci    })
561cb0ef41Sopenharmony_ci  }, "request.formData() with input: " + val.input)
571cb0ef41Sopenharmony_ci
581cb0ef41Sopenharmony_ci  promise_test(() => {
591cb0ef41Sopenharmony_ci    let init = new Response(val.input, { headers: {"Content-Type": "application/x-www-form-urlencoded;charset=shift_jis"} }).formData()
601cb0ef41Sopenharmony_ci    return init.then((fd) => {
611cb0ef41Sopenharmony_ci      let i = 0
621cb0ef41Sopenharmony_ci      for (let item of fd) {
631cb0ef41Sopenharmony_ci         assert_array_equals(item, val.output[i])
641cb0ef41Sopenharmony_ci         i++
651cb0ef41Sopenharmony_ci      }
661cb0ef41Sopenharmony_ci    })
671cb0ef41Sopenharmony_ci  }, "response.formData() with input: " + val.input)
681cb0ef41Sopenharmony_ci});
69