Revision fdc6e085458e80d3bfccfe59dc47adc7dd14bc45 authored by Ehsan Karamad on 28 June 2018, 14:54:59 UTC, committed by Blink WPT Bot on 28 June 2018, 15:04:24 UTC
The test has been previously disabled (skipped) on Windows due to
recurrent timeouts. Running the test locally leads to an average of ~
3.7 sec runtime on a high-performance Windows 10 rig (Z840). The test is
not skipped on Linux right now, but since its runtime exceeds the 2 sec
rule of thumb (from the comments in SlowTests), this CL will make it
slow on Linux as well.

Bug: 850964
Change-Id: Ib478c0f59313da4302325578d9b768e1070bdcb6
Reviewed-on: https://chromium-review.googlesource.com/1115214
Reviewed-by: Ehsan Karamad <ekaramad@chromium.org>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Ehsan Karamad <ekaramad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571116}
1 parent 9704386
Raw File
send-timeout-events.htm
<!DOCTYPE html>
<html>
<head>
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
    <title>XMLHttpRequest: The send() method: timeout is not 0 </title>
</head>

<body>
    <div id="log"></div>

    <script type="text/javascript">
        async_test(t => {
            const xhr = new XMLHttpRequest(),
                  expect = [4, "", "upload.timeout", "upload.loadend", "timeout", "loadend"];
            let actual = [];

            xhr.onreadystatechange = t.step_func(() => {
                if (xhr.readyState == 4) {
                    actual.push(xhr.readyState, xhr.response);
                }
            });

            xhr.onloadend = t.step_func_done(e => {
                assert_equals(e.loaded, 0);
                assert_equals(e.total, 0);
                actual.push(e.type);
                assert_array_equals(actual, expect);
            });

            xhr.ontimeout = t.step_func(e => {
                assert_equals(e.loaded, 0);
                assert_equals(e.total, 0);
                actual.push(e.type);
            });


            xhr.upload.onloadend = t.step_func(e => {
                assert_equals(e.loaded, 0);
                assert_equals(e.total, 0);
                actual.push("upload." + e.type);
            });

            xhr.upload.ontimeout = t.step_func(e => {
                assert_equals(e.loaded, 0);
                assert_equals(e.total, 0);
                actual.push("upload." + e.type);
            });


            let content = "";
            for (var i = 0; i < 121026; i++) {
                content += "[" + i + "]";
            }

            xhr.open("POST", "./resources/trickle.py", true);
            xhr.timeout = 1;
            xhr.send(content);
        });
    </script>
</body>
</html>
back to top