mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1143813 - Add tests for attempting to store a non-GET request in the DOM Cache; r=bkelly
This commit is contained in:
parent
e9c57f7ec1
commit
d54b1dad9e
@ -46,6 +46,19 @@ function testRequest(request1, request2, request3, unknownRequest) {
|
||||
return c.add(request1);
|
||||
}).then(function() {
|
||||
return c.add(request3);
|
||||
}).then(function() {
|
||||
return Promise.all(
|
||||
["HEAD", "POST", "PUT", "DELETE", "OPTIONS"]
|
||||
.map(function(method) {
|
||||
var r = new Request(request1, {method: method});
|
||||
return c.add(r)
|
||||
.then(function() {
|
||||
ok(false, "Promise should be rejected");
|
||||
}, function(err) {
|
||||
is(err.name, "TypeError", "Adding a request with type '" + method + "' should fail");
|
||||
});
|
||||
})
|
||||
);
|
||||
}).then(function() {
|
||||
return c.matchAll(request1);
|
||||
}).then(function(r) {
|
||||
|
@ -35,6 +35,19 @@ function testRequest(request, unknownRequest) {
|
||||
return caches.open(name).then(function(cache) {
|
||||
c = cache;
|
||||
return c.add(request);
|
||||
}).then(function() {
|
||||
return Promise.all(
|
||||
["HEAD", "POST", "PUT", "DELETE", "OPTIONS"]
|
||||
.map(function(method) {
|
||||
var r = new Request(request, {method: method});
|
||||
return c.add(r)
|
||||
.then(function() {
|
||||
ok(false, "Promise should be rejected");
|
||||
}, function(err) {
|
||||
is(err.name, "TypeError", "Adding a request with type '" + method + "' should fail");
|
||||
});
|
||||
})
|
||||
);
|
||||
}).then(function() {
|
||||
return c.match(request);
|
||||
}).then(function(r) {
|
||||
|
Loading…
Reference in New Issue
Block a user