OLD | NEW |
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 Loading... |
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 Loading... |
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> |
OLD | NEW |