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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/fetch-request-xhr-iframe.html

Issue 1762893002: Reland of Set the request mode and the credentials mode of FetchEvent in the service worker correct… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated tyoshino's comment Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 <script src="../../resources/testharness.js"></script> 1 <script src="../../resources/testharness.js"></script>
2 <script src="../../resources/get-host-info.js?pipe=sub"></script> 2 <script src="../../resources/get-host-info.js?pipe=sub"></script>
3 <script src="test-helpers.js"></script> 3 <script src="test-helpers.js"></script>
4 <script> 4 <script>
5 var host_info = get_host_info(); 5 var host_info = get_host_info();
6 6
7 function get_boundary(headers) { 7 function get_boundary(headers) {
8 var reg = new RegExp('multipart\/form-data; boundary=(.*)'); 8 var reg = new RegExp('multipart\/form-data; boundary=(.*)');
9 for (var i = 0; i < headers.length; ++i) { 9 for (var i = 0; i < headers.length; ++i) {
10 if (headers[i][0] != 'content-type') { 10 if (headers[i][0] != 'content-type') {
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 'fs file content\r\n' + 126 'fs file content\r\n' +
127 '--' + boundary + '--\r\n'; 127 '--' + boundary + '--\r\n';
128 assert_equals(response.body, expected_body); 128 assert_equals(response.body, expected_body);
129 }); 129 });
130 } 130 }
131 131
132 function mode_credentials_test() { 132 function mode_credentials_test() {
133 return xhr_send(host_info['HTTP_ORIGIN'], 'GET', '', false) 133 return xhr_send(host_info['HTTP_ORIGIN'], 'GET', '', false)
134 .then(function(response){ 134 .then(function(response){
135 assert_equals(response.mode, 'cors'); 135 assert_equals(response.mode, 'cors');
136 assert_equals(response.credentials, 'same-origin'); 136 assert_equals(response.credentials, 'include');
137 return xhr_send(host_info['HTTP_ORIGIN'], 'GET', '', true); 137 return xhr_send(host_info['HTTP_ORIGIN'], 'GET', '', true);
138 }) 138 })
139 .then(function(response){ 139 .then(function(response){
140 assert_equals(response.mode, 'cors'); 140 assert_equals(response.mode, 'cors');
141 assert_equals(response.credentials, 'include'); 141 assert_equals(response.credentials, 'include');
142 return xhr_send(host_info['HTTP_REMOTE_ORIGIN'], 'GET', '', false); 142 return xhr_send(host_info['HTTP_REMOTE_ORIGIN'], 'GET', '', false);
143 }) 143 })
144 .then(function(response){ 144 .then(function(response){
145 assert_equals(response.mode, 'cors'); 145 assert_equals(response.mode, 'cors');
146 assert_equals(response.credentials, 'same-origin'); 146 assert_equals(response.credentials, 'same-origin');
(...skipping 29 matching lines...) Expand all
176 .then(blob_test) 176 .then(blob_test)
177 .then(custom_method_test) 177 .then(custom_method_test)
178 .then(options_method_test) 178 .then(options_method_test)
179 .then(form_data_test) 179 .then(form_data_test)
180 .then(mode_credentials_test) 180 .then(mode_credentials_test)
181 .then(data_url_test) 181 .then(data_url_test)
182 .then(function() { port.postMessage({results: 'finish'}); }) 182 .then(function() { port.postMessage({results: 'finish'}); })
183 .catch(function(e) { port.postMessage({results: 'failure:' + e}); }); 183 .catch(function(e) { port.postMessage({results: 'failure:' + e}); });
184 }); 184 });
185 </script> 185 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698