summaryrefslogtreecommitdiffstats
path: root/dom/base/test/file_browser_refresh_content.html
diff options
context:
space:
mode:
Diffstat (limited to 'dom/base/test/file_browser_refresh_content.html')
-rw-r--r--dom/base/test/file_browser_refresh_content.html41
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>