зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1319846 P3 Add a wpt test verifying Cache API can store and reproduce Response.redirect(). r=asuth
This commit is contained in:
Родитель
3806e267dc
Коммит
8eea6736f4
|
@ -284,4 +284,22 @@ cache_test(function(cache) {
|
|||
'TypeError.');
|
||||
}, 'Cache.put with an embedded VARY:* Response');
|
||||
|
||||
cache_test(function(cache) {
|
||||
var url = 'foo.html';
|
||||
var redirectURL = 'http://example.com/foo-bar.html';
|
||||
var redirectResponse = Response.redirect(redirectURL);
|
||||
assert_equals(redirectResponse.headers.get('Location'), redirectURL,
|
||||
'Response.redirect() should set Location header.');
|
||||
return cache.put(url, redirectResponse.clone())
|
||||
.then(function() {
|
||||
return cache.match(url);
|
||||
})
|
||||
.then(function(response) {
|
||||
assert_response_equals(response, redirectResponse,
|
||||
'Redirect response is reproduced by the Cache API');
|
||||
assert_equals(response.headers.get('Location'), redirectURL,
|
||||
'Location header is preserved by Cache API.');
|
||||
});
|
||||
}, 'Cache.put should store Response.redirect() correctly');
|
||||
|
||||
done();
|
||||
|
|
Загрузка…
Ссылка в новой задаче