diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /dom/base/test/file_browser_refresh_content.html | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/base/test/file_browser_refresh_content.html')
-rw-r--r-- | dom/base/test/file_browser_refresh_content.html | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/dom/base/test/file_browser_refresh_content.html b/dom/base/test/file_browser_refresh_content.html new file mode 100644 index 0000000000..aa338efd3f --- /dev/null +++ b/dom/base/test/file_browser_refresh_content.html @@ -0,0 +1,41 @@ +<html> + <body> + <img src="file_browser_refresh_image.sjs"> + <iframe src="file_browser_refresh_iframe.sjs"></iframe> + <div id="result"></div> + + <canvas id="canvas" width="100" height="100"> </canvas> + <script> + const image = document.querySelector("img"); + const iframe = document.querySelector("iframe"); + const result = document.getElementById("result"); + + iframe.addEventListener("load", function() { + result.setAttribute( + "iframeContent", + iframe.contentDocument.body.textContent + ); + }); + + // Ensure images are loaded + image.addEventListener("load", function() { + var canvas = document.getElementById('canvas'); + var ctx = canvas.getContext('2d'); + ctx.drawImage(image, 0, 0); + + result.setAttribute("imageDataURL", canvas.toDataURL()); + }); + + // Ensure expired resources are still loaded + fetch('./file_browser_refresh_expired_resource.sjs').then((response) => { + let cacheControl = response.headers.get('Cache-Control'); + result.setAttribute("expiredResourceCacheControl", cacheControl); + }); + + // Ensure non cacheable resources are still loaded + fetch('./file_browser_refresh_non_cacheable.sjs').then(() => { + result.setAttribute("nonCacheableResourceCompleted", true); + }); + </script> + </body> +</html> |