mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1319846 P3 Add a wpt test verifying Cache API can store and reproduce Response.redirect(). r=asuth
This commit is contained in:
parent
3806e267dc
commit
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();
|
||||
|
Loading…
Reference in New Issue
Block a user