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

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

Issue 743653002: [ServiceWorker] support OPTIONS request for ServiceWorker [3/3 blink] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | Source/core/loader/DocumentThreadableLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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}); });
});
« no previous file with comments | « no previous file | Source/core/loader/DocumentThreadableLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698