| Index: LayoutTests/http/tests/serviceworker/resources/fetch-response-xhr-iframe.html
|
| diff --git a/LayoutTests/http/tests/serviceworker/resources/fetch-response-xhr-iframe.html b/LayoutTests/http/tests/serviceworker/resources/fetch-response-xhr-iframe.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9f0bf04587d0b6d8db7cd31d607c32f460a3cd06
|
| --- /dev/null
|
| +++ b/LayoutTests/http/tests/serviceworker/resources/fetch-response-xhr-iframe.html
|
| @@ -0,0 +1,33 @@
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="test-helpers.js?pipe=sub"></script>
|
| +<script>
|
| +
|
| +function xhr_send(method, data) {
|
| + return new Promise(function(resolve, reject) {
|
| + var xhr = new XMLHttpRequest();
|
| + xhr.onload = function() {
|
| + resolve(xhr);
|
| + };
|
| + xhr.onerror = function() {
|
| + reject('XHR should succeed.');
|
| + };
|
| + xhr.responseType = 'text';
|
| + xhr.open(method, './dummy?test', true);
|
| + xhr.send(data);
|
| + });
|
| +}
|
| +
|
| +function coalesce_headers_test() {
|
| + return xhr_send('POST', 'test string')
|
| + .then(function(xhr) {
|
| + assert_equals(xhr.getResponseHeader('foo'), 'foo, bar');
|
| + });
|
| +}
|
| +
|
| +window.addEventListener('message', function(evt) {
|
| + var port = evt.ports[0];
|
| + coalesce_headers_test()
|
| + .then(function() { port.postMessage({results: 'finish'}); })
|
| + .catch(function(e) { port.postMessage({results: 'failure:' + e}); });
|
| + });
|
| +</script>
|
|
|