fetch-event-respond-with-body-loaded-in-chunk.https.html (1064B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>respondWith with a response whose body is being loaded from the network by chunks</title> 4 <meta name="timeout" content="long"> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <script src="resources/test-helpers.sub.js"></script> 8 <script> 9 'use strict'; 10 11 const WORKER = 'resources/fetch-event-respond-with-body-loaded-in-chunk-worker.js'; 12 const SCOPE = 'resources/fetch-event-respond-with-body-loaded-in-chunk-iframe.html'; 13 14 promise_test(async t => { 15 var reg = await service_worker_unregister_and_register(t, WORKER, SCOPE); 16 add_completion_callback(() => reg.unregister()); 17 await wait_for_state(t, reg.installing, 'activated'); 18 let iframe = await with_iframe(SCOPE); 19 t.add_cleanup(() => iframe.remove()); 20 21 let response = await iframe.contentWindow.fetch('body-in-chunk'); 22 assert_equals(await response.text(), 'TEST_TRICKLE\nTEST_TRICKLE\nTEST_TRICKLE\nTEST_TRICKLE\n'); 23 }, 'Respond by chunks with a Response being loaded'); 24 </script>