mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1176988 - Patch 3 - Tests. r=jdm
Update web-platform-tests expected data
This commit is contained in:
parent
eef87c3ddd
commit
03f2de8e31
@ -1,4 +1,4 @@
|
||||
function fetchXHR(name, onload, onerror, headers) {
|
||||
function fetchXHRWithMethod(name, method, onload, onerror, headers) {
|
||||
expectAsyncResult();
|
||||
|
||||
onload = onload || function() {
|
||||
@ -11,7 +11,7 @@ function fetchXHR(name, onload, onerror, headers) {
|
||||
};
|
||||
|
||||
var x = new XMLHttpRequest();
|
||||
x.open('GET', name, true);
|
||||
x.open(method, name, true);
|
||||
x.onload = function() { onload(x) };
|
||||
x.onerror = function() { onerror(x) };
|
||||
headers = headers || [];
|
||||
@ -21,6 +21,10 @@ function fetchXHR(name, onload, onerror, headers) {
|
||||
x.send();
|
||||
}
|
||||
|
||||
function fetchXHR(name, onload, onerror, headers) {
|
||||
return fetchXHRWithMethod(name, 'GET', onload, onerror, headers);
|
||||
}
|
||||
|
||||
fetchXHR('bare-synthesized.txt', function(xhr) {
|
||||
my_ok(xhr.status == 200, "load should be successful");
|
||||
my_ok(xhr.responseText == "synthesized response body", "load should have synthesized response");
|
||||
@ -297,3 +301,11 @@ fetch(new Request('body-blob', {method: 'POST', body: new Blob(new String('my bo
|
||||
my_ok(body == 'my bodymy body', "the Blob body of the intercepted fetch should be visible in the SW");
|
||||
finish();
|
||||
});
|
||||
|
||||
['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'].forEach(function(method) {
|
||||
fetchXHRWithMethod('xhr-method-test.txt', method, function(xhr) {
|
||||
my_ok(xhr.status == 200, method + " load should be successful");
|
||||
my_ok(xhr.responseText == ("intercepted " + method), method + " load should have synthesized response");
|
||||
finish();
|
||||
});
|
||||
});
|
||||
|
@ -268,4 +268,8 @@ onfetch = function(ev) {
|
||||
var url = 'http://example.com/tests/dom/security/test/cors/file_CrossSiteXHR_server.sjs?status=200';
|
||||
ev.respondWith(fetch(url, { mode: 'no-cors' }));
|
||||
}
|
||||
|
||||
else if (ev.request.url.includes('xhr-method-test.txt')) {
|
||||
ev.respondWith(new Response('intercepted ' + ev.request.method));
|
||||
}
|
||||
};
|
||||
|
@ -3,9 +3,6 @@
|
||||
[XMLHttpRequest: setRequestHeader() - headers that are allowed (Authorization)]
|
||||
expected: FAIL
|
||||
|
||||
[XMLHttpRequest: setRequestHeader() - headers that are allowed (Pragma)]
|
||||
expected: FAIL
|
||||
|
||||
[XMLHttpRequest: setRequestHeader() - headers that are allowed (Content-Transfer-Encoding)]
|
||||
expected: FAIL
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user