Files
firefox/testing/web-platform/tests/fetch/api/request/request-keepalive.html
T
youennf b9c00d546a Bug 1550264 [wpt PR 16572] - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=197338, a=testonly
Automatic update from web-platform-tests
WebKit export of https://bugs.webkit.org/show_bug.cgi?id=197338 (#16572)

--

wpt-commits: b7bf251983d92263ec77067f473267274870229e
wpt-pr: 16572
2019-06-05 10:27:41 +01:00

29 lines
969 B
HTML

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Request keepalive</title>
<meta name="help" href="https://fetch.spec.whatwg.org/#request">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/utils.js"></script>
<script src="/common/get-host-info.sub.js"></script>
</head>
<body>
<script>
test(() => {
assert_false(new Request('/').keepalive, 'default');
assert_true(new Request('/', {keepalive: true}).keepalive, 'true');
assert_false(new Request('/', {keepalive: false}).keepalive, 'false');
assert_true(new Request('/', {keepalive: 1}).keepalive, 'truish');
assert_false(new Request('/', {keepalive: 0}).keepalive, 'falsy');
}, 'keepalive flag');
test(() => {
const init = {method: 'POST', keepalive: true, body: new ReadableStream()};
assert_throws(new TypeError(), () => {new Request('/', init)});
}, 'keepalive flag with stream body');
</script>
</body>
</html>