| Index: LayoutTests/fast/files/workers/resources/worker-apply-blob-url-to-xhr.js
|
| diff --git a/LayoutTests/fast/files/workers/resources/worker-apply-blob-url-to-xhr.js b/LayoutTests/fast/files/workers/resources/worker-apply-blob-url-to-xhr.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..1528b546887fc8cbfb0818e76ec1532817c2c267
|
| --- /dev/null
|
| +++ b/LayoutTests/fast/files/workers/resources/worker-apply-blob-url-to-xhr.js
|
| @@ -0,0 +1,36 @@
|
| +function log(message)
|
| +{
|
| + postMessage(message);
|
| +}
|
| +
|
| +function sendXMLHttpRequest(method, url)
|
| +{
|
| + var xhr = new XMLHttpRequest();
|
| + xhr.open(method, url, false);
|
| + try {
|
| + xhr.send();
|
| + log("Status: " + xhr.status);
|
| + log("Response: " + xhr.responseText);
|
| + } catch (error) {
|
| + log("Received exception, code: " + error.code + ", name: " + error.name + ", message: " + error.message);
|
| + }
|
| +}
|
| +
|
| +onmessage = function(event)
|
| +{
|
| + var file = event.data;
|
| + var fileURL = URL.createObjectURL(file);
|
| +
|
| + log("Test that XMLHttpRequest GET succeeds.");
|
| + sendXMLHttpRequest("GET", fileURL);
|
| +
|
| + log("Test that XMLHttpRequest POST fails.");
|
| + xhr = new XMLHttpRequest();
|
| + sendXMLHttpRequest("POST", fileURL);
|
| +
|
| + log("Test that XMLHttpRequest GET fails after the blob URL is revoked.");
|
| + URL.revokeObjectURL(fileURL);
|
| + sendXMLHttpRequest("GET", fileURL);
|
| +
|
| + log("DONE");
|
| +}
|
|
|