Index: LayoutTests/http/tests/serviceworker/resources/fetch-request-xhr-iframe.html |
diff --git a/LayoutTests/http/tests/serviceworker/resources/fetch-request-xhr-iframe.html b/LayoutTests/http/tests/serviceworker/resources/fetch-request-xhr-iframe.html |
index 06de143fcb312017ba82bb4ddda878bb4de2e1a2..7391fe5083e399ad2aa743e1049829884808aedd 100644 |
--- a/LayoutTests/http/tests/serviceworker/resources/fetch-request-xhr-iframe.html |
+++ b/LayoutTests/http/tests/serviceworker/resources/fetch-request-xhr-iframe.html |
@@ -73,12 +73,20 @@ function blob_test() { |
function custom_method_test() { |
return xhr_send(host_info['HTTP_ORIGIN'], 'XXX', 'test string xxx', false) |
- .then(function(response){ |
+ .then(function(response) { |
assert_equals(response.method, 'XXX'); |
assert_equals(response.body, 'test string xxx'); |
}); |
} |
+function options_method_test() { |
+ return xhr_send(host_info['HTTP_ORIGIN'], 'OPTIONS', 'test string xxx', false) |
+ .then(function(response) { |
+ assert_equals(response.method, 'OPTIONS'); |
+ assert_equals(response.body, 'test string xxx'); |
+ }); |
+} |
+ |
function form_data_test() { |
return create_file_system_file('fsfile.txt', 'fs file content') |
.then(function(file_system_file) { |
@@ -161,39 +169,15 @@ function data_url_test() { |
}); |
} |
-function xhr_options_test() { |
- return new Promise(function(resolve, reject) { |
- var xhr = new XMLHttpRequest(); |
- xhr.onload = function() { |
- resolve(xhr.response); |
- }; |
- xhr.onerror = function() { |
- reject('XHR should succeed.'); |
- }; |
- xhr.responseType = 'text'; |
- xhr.open('OpTiOnS', 'fetch-access-control.php', true); |
- xhr.send(); |
- }) |
- .then(function(data) { |
- var result; |
- var report = function(arg) { |
- result = arg; |
- }; |
- eval(data); |
- assert_equals(result['jsonpResult'], 'success'); |
- assert_equals(result['method'], 'OPTIONS'); |
- }) |
-} |
- |
window.addEventListener('message', function(evt) { |
var port = evt.ports[0]; |
string_test() |
.then(blob_test) |
.then(custom_method_test) |
+ .then(options_method_test) |
.then(form_data_test) |
.then(mode_credentials_test) |
.then(data_url_test) |
- .then(xhr_options_test) |
.then(function() { port.postMessage({results: 'finish'}); }) |
.catch(function(e) { port.postMessage({results: 'failure:' + e}); }); |
}); |