зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1143813 - Add tests for attempting to store a non-GET request in the DOM Cache; r=bkelly
This commit is contained in:
Родитель
791ff66ebf
Коммит
56026081c7
|
@ -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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче