summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/xhr/send-data-formdata.any.js
blob: 6ff04793ea65057a095dd3389eee10a5db77966f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// META: title=XMLHttpRequest.send(formdata)

var test = async_test();
test.step(function()
{
    var xhr = new XMLHttpRequest();
    var form = new FormData();
    form.append("id", "0");
    form.append("value", "zero");

    xhr.onreadystatechange = test.step_func(() => {
        if (xhr.readyState == 4) {
            assert_equals(xhr.status, 200);
            assert_equals(xhr.response, "id:0;value:zero;");
            test.done();
        }
    });

    xhr.open("POST", "./resources/form.py", true);
    xhr.send(form);
});