| Index: third_party/WebKit/LayoutTests/http/tests/serviceworker/respond-with-response-body-with-invalid-chunk.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/respond-with-response-body-with-invalid-chunk.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/respond-with-response-body-with-invalid-chunk.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..075c48acf6c188b08342ffc2bf7293a0f11da0e1
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/respond-with-response-body-with-invalid-chunk.html
|
| @@ -0,0 +1,30 @@
|
| +<!DOCTYPE html>
|
| +<meta charset="utf-8">
|
| +<title>respondWith with response body having invalid chunks</title>
|
| +<script src="/resources/testharness.js"></script>
|
| +<script src="/resources/testharnessreport.js"></script>
|
| +<script src="resources/test-helpers.js"></script>
|
| +<script>
|
| +const WORKER =
|
| + 'resources/respond-with-response-body-with-invalid-chunk-worker.js';
|
| +const SCOPE =
|
| + 'resources/respond-with-response-body-with-invalid-chunk-iframe.html';
|
| +var resolve_done;
|
| +var done_was_called = new Promise(resolve => resolve_done = resolve);
|
| +// Called by the iframe when done.
|
| +function done(result) { resolve_done(result); }
|
| +
|
| +// This test creates an controlled iframe that makes a fetch request. The
|
| +// service worker returns a response with a body stream containing an invalid
|
| +// chunk.
|
| +promise_test(t => {
|
| + return service_worker_unregister_and_register(t, WORKER, SCOPE)
|
| + .then(reg => {
|
| + add_completion_callback(() => reg.unregister());
|
| + return wait_for_state(t, reg.installing, 'activated');
|
| + })
|
| + .then(() => with_iframe(SCOPE))
|
| + .then(() => done_was_called)
|
| + .then(result => assert_equals(result, 'PASS'));
|
| + }, 'Response with a ReadableStream having non-Uint8Array chunks should be transferred as errored');
|
| +</script>
|
|
|