Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Unified Diff: content/test/data/download/download-attribute-blob.html

Issue 1829413002: [Downloads] Retain a BlobDataHandle in DownloadUrlParameters. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/test/data/download/download-attribute-blob.html
diff --git a/content/test/data/download/download-attribute-blob.html b/content/test/data/download/download-attribute-blob.html
new file mode 100644
index 0000000000000000000000000000000000000000..b114c0db8b0602e7967edbabfafbe27a1de90e53
--- /dev/null
+++ b/content/test/data/download/download-attribute-blob.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<body>
+<a download="suggested-filename" href="">link</a>
+
+<!-- In addition to initiating a download using a Blob URL, the script below
+ will immediately revoke the URL as soon as the click() event has been
+ dispatched. This tests that, in addition to handling the blob URL, that
+ proper lifetime extensions are in place to prevent the blob from going away
+ before the download is complete. -->
+
+<script>
+var anchorElement = document.querySelector('a[download]');
+var blob = new Blob(['hello world!'], {type: 'text/plain'});
+var url = URL.createObjectURL(blob);
+anchorElement.href = url;
+anchorElement.click();
+URL.revokeObjectURL(url);
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698