mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1144236 - Add tests for the ignoreMethod match mode in DOM cache; r=bkelly
This commit is contained in:
parent
58dbbe9814
commit
2b77f254df
@ -74,6 +74,26 @@ function testRequest(request1, request2, request3, unknownRequest,
|
||||
}).then(function(r) {
|
||||
is(r.length, 1, "Should only find 1 item");
|
||||
return checkResponse(r[0], response1, response1Text);
|
||||
}).then(function() {
|
||||
return c.matchAll(new Request(request1, {method: "HEAD"}));
|
||||
}).then(function(r) {
|
||||
is(r.length, 1, "Should only find 1 item");
|
||||
return checkResponse(r[0], response1, response1Text);
|
||||
}).then(function() {
|
||||
return Promise.all(
|
||||
["POST", "PUT", "DELETE", "OPTIONS"]
|
||||
.map(function(method) {
|
||||
var req = new Request(request1, {method: method});
|
||||
return c.matchAll(req)
|
||||
.then(function(r) {
|
||||
is(r.length, 0, "Searching for a request with a non-GET/HEAD method should not succeed");
|
||||
return c.matchAll(req, {ignoreMethod: true});
|
||||
}).then(function(r) {
|
||||
is(r.length, 1, "Should only find 1 item");
|
||||
return checkResponse(r[0], response1, response1Text);
|
||||
});
|
||||
})
|
||||
);
|
||||
}).then(function() {
|
||||
return c.matchAll(requestWithDifferentFragment);
|
||||
}).then(function(r) {
|
||||
|
@ -60,6 +60,24 @@ function testRequest(request, unknownRequest, requestWithAlternateQueryString,
|
||||
return c.match(request);
|
||||
}).then(function(r) {
|
||||
return checkResponse(r);
|
||||
}).then(function() {
|
||||
return c.match(new Request(request, {method: "HEAD"}));
|
||||
}).then(function(r) {
|
||||
return checkResponse(r);
|
||||
}).then(function() {
|
||||
return Promise.all(
|
||||
["POST", "PUT", "DELETE", "OPTIONS"]
|
||||
.map(function(method) {
|
||||
var req = new Request(request, {method: method});
|
||||
return c.match(req)
|
||||
.then(function(r) {
|
||||
is(typeof r, "undefined", "Searching for a request with a non-GET/HEAD method should not succeed");
|
||||
return c.match(req, {ignoreMethod: true});
|
||||
}).then(function(r) {
|
||||
return checkResponse(r);
|
||||
});
|
||||
})
|
||||
);
|
||||
}).then(function() {
|
||||
return caches.match(request);
|
||||
}).then(function(r) {
|
||||
|
Loading…
Reference in New Issue
Block a user