Update web-platform-tests to revision c26470dac73f2df9d4822a0d3482f7eb1ebf57d9

This commit is contained in:
Anthony Ramine 2018-01-10 14:28:20 +01:00
parent 7de87c487b
commit 4d3c932c47
648 changed files with 9014 additions and 4821 deletions

View file

@ -1,41 +0,0 @@
<!doctype html>
<title>Revoking blob URL used with Request/fetch</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
promise_test(function(t) {
const blob = new Blob(["test"]);
const url = URL.createObjectURL(blob);
const request = new Request(url);
// Revoke the object URL. Request should take a reference to the blob as
// soon as it receives it in open(), so the request succeeds even though we
// revoke the URL before calling fetch().
URL.revokeObjectURL(url);
return fetch(request).then(response => response.text()).then(text => {
assert_equals(text, 'test');
});
}, "Revoke blob URL after creating Request, will fetch");
promise_test(function(t) {
const blob = new Blob(["test"]);
const url = URL.createObjectURL(blob);
return fetch(url).then(response => response.text()).then(text => {
assert_equals(text, 'test');
});
// Revoke the object URL. fetch should have already resolved the blob URL.
URL.revokeObjectURL(url);
}, "Revoke blob URL after fetch, will fetch");
promise_test(t => {
const blob = new Blob(["test"]);
const url = URL.createObjectURL(blob);
URL.revokeObjectURL(url);
const request = new Request(url);
return promise_rejects(t, new TypeError, fetch(request));
}, "Revoke blob URL before creating Request, network error (after fetch)")
</script>

View file

@ -1,38 +0,0 @@
<!doctype html>
<title>Revoking blob URL used with XMLHttpRequest</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
async_test(function(t) {
var blob = new Blob(["test"]);
var url = URL.createObjectURL(blob);
var xhr = new XMLHttpRequest();
xhr.open("GET", url);
// Revoke the object URL. XHR should take a reference to the blob as soon as
// it receives it in open(), so the request succeeds even though we revoke the
// URL before calling send().
URL.revokeObjectURL(url);
xhr.send();
xhr.onload = t.step_func_done(function() {
assert_equals(xhr.response, "test");
})
xhr.onerror = t.step_func(function() {
assert_unreached("Got unexpected error event");
})
}, "Revoke blob URL after open(), will fetch");
async_test(t => {
const blob = new Blob(["test"]),
blobURL = URL.createObjectURL(blob),
client = new XMLHttpRequest
URL.revokeObjectURL(blobURL)
client.open("GET", blobURL)
client.onload = t.step_func(() => assert_unreached("Got unexpected load event"))
client.onerror = t.step_func_done()
client.send()
}, "Revoke blob URL before open(), network error (after send())")
</script>