Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Unified Diff: LayoutTests/http/tests/serviceworker/resources/fetch-response-xhr-iframe.html

Issue 564773004: Fix conversion to WebServiceWorkerResponse headers. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added xhr end-to-end test Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698