Chromium Code Reviews| Index: LayoutTests/http/tests/serviceworker/fetch-event.html |
| diff --git a/LayoutTests/http/tests/serviceworker/fetch-event.html b/LayoutTests/http/tests/serviceworker/fetch-event.html |
| index fd6aba2e8819d1a0dda77511515e1417841a0341..8c85706e84e601388c0370605fcdd12f73ef4cf0 100644 |
| --- a/LayoutTests/http/tests/serviceworker/fetch-event.html |
| +++ b/LayoutTests/http/tests/serviceworker/fetch-event.html |
| @@ -149,5 +149,49 @@ async_test(function(t) { |
| })) |
| .catch(unreached_rejection(t)); |
| }, 'Service Worker fetches other file in fetch event'); |
| + |
| +async_test(function(t) { |
| + var scope = 'resources/simple.html?form-post'; |
| + var frame_name = 'xhr-post-frame'; |
| + service_worker_unregister_and_register(t, worker, scope) |
| + .then(function(registration) { |
| + return wait_for_update(t, registration); |
| + }) |
| + .then(t.step_func(function(sw) { |
| + return wait_for_state(t, sw, 'activated'); |
| + })) |
| + .then(t.step_func(function(sw) { |
| + return new Promise(function(resolve) { |
| + var frame = document.createElement('iframe'); |
| + frame.name = frame_name; |
| + document.body.appendChild(frame); |
| + var form = document.createElement('form'); |
| + form.target = frame_name; |
| + form.action = scope; |
| + form.method = 'post'; |
| + var input1 = document.createElement('input'); |
| + input1.type = 'text'; |
| + input1.value = 'testValue1'; |
| + input1.name = 'testName1' |
| + form.appendChild(input1); |
| + var input2 = document.createElement('input'); |
| + input2.type = 'text'; |
| + input2.value = 'testValue2'; |
| + input2.name = 'testName2' |
| + form.appendChild(input2); |
| + document.body.appendChild(form); |
| + frame.onload = function() { |
| + resolve(frame); |
|
falken
2014/08/19 04:08:25
can you remove the form here? (or maybe it can be
horo
2014/08/19 04:46:14
Done.
|
| + }; |
| + form.submit(); |
| + }); |
| + })) |
| + .then(t.step_func(function(frame) { |
|
falken
2014/08/19 04:08:25
can you remove the frame here
horo
2014/08/19 04:46:14
Done.
|
| + assert_equals(frame.contentDocument.body.textContent, |
| + 'POST:testName1=testValue1&testName2=testValue2'); |
| + return service_worker_unregister_and_done(t, scope); |
| + })) |
| + .catch(unreached_rejection(t)); |
| + }, 'Service Worker responds to fetch event with POST form'); |
| </script> |
| </body> |