Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / serviceworker / chromium / respond-with-body-accessed-response.html
blobf701dc4088dc464cd78870870be132b6b25d4579
1 <!DOCTYPE html>
2 <title>Service Worker responds with .body accessed response.</title>
3 <!--
4 We put this test in serviceworker/chromium/ directory because the behavior of
5 Response.body is still under the spec discussion.
6 FIXME: When the spec will be released, move this test to serviceworker/
7 directory.
8 -->
9 <script src="../../resources/testharness.js"></script>
10 <script src="../../resources/testharnessreport.js"></script>
11 <script src="../resources/test-helpers.js"></script>
12 <script>
14 async_test(function(t) {
15 var SCOPE = 'resources/respond-with-body-accessed-response-iframe.html';
16 var SCRIPT = 'resources/respond-with-body-accessed-response-worker.js';
17 var frame;
19 service_worker_unregister_and_register(t, SCRIPT, SCOPE)
20 .then(function(reg) {
21 return wait_for_state(t, reg.installing, 'activated');
23 .then(function() { return with_iframe(SCOPE); })
24 .then(function(f) {
25 frame = f;
26 return frame.contentWindow.do_test();
28 .then(function() {
29 frame.remove();
30 return service_worker_unregister_and_done(t, SCOPE);
32 .catch(unreached_rejection(t));
33 }, 'Service Worker responds with .body accessed response.');
35 </script>