summaryrefslogtreecommitdiffstats
path: root/dom/serviceworkers/test/fetch/imagecache-maxage/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'dom/serviceworkers/test/fetch/imagecache-maxage/index.html')
-rw-r--r--dom/serviceworkers/test/fetch/imagecache-maxage/index.html29
1 files changed, 29 insertions, 0 deletions
diff --git a/dom/serviceworkers/test/fetch/imagecache-maxage/index.html b/dom/serviceworkers/test/fetch/imagecache-maxage/index.html
new file mode 100644
index 0000000000..0d4c52eedd
--- /dev/null
+++ b/dom/serviceworkers/test/fetch/imagecache-maxage/index.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<script>
+var width, url, width2, url2;
+function maybeReport() {
+ if (width !== undefined && url !== undefined &&
+ width2 !== undefined && url2 !== undefined) {
+ window.parent.postMessage({status: "result",
+ width,
+ width2,
+ url,
+ url2}, "*");
+ }
+}
+onload = function() {
+ width = document.querySelector("img").width;
+ width2 = document.querySelector("img").width;
+ maybeReport();
+};
+navigator.serviceWorker.onmessage = function(event) {
+ if (event.data.suffix == "2") {
+ url2 = event.data.url;
+ } else {
+ url = event.data.url;
+ }
+ maybeReport();
+};
+</script>
+<img src="image.png">
+<img src="image2.png">