Index: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/fetch-request-fallback-iframe.html |
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/fetch-request-fallback-iframe.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/fetch-request-fallback-iframe.html |
index f00d24e37a8270cf65c0322c2dabb5d1a20910d2..37c7c62ffaf38b0a906da928a56c054e04d9a873 100644 |
--- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/fetch-request-fallback-iframe.html |
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/fetch-request-fallback-iframe.html |
@@ -12,4 +12,21 @@ function xhr(url) { |
request.send(); |
}); |
} |
+ |
+function load_image(url, cross_origin) { |
+ return new Promise(function(resolve, reject) { |
+ var img = document.createElement('img'); |
+ document.body.appendChild(img); |
+ img.onload = function() { |
+ resolve(); |
+ }; |
+ img.onerror = function() { |
+ reject(); |
+ }; |
+ if (cross_origin != '') { |
+ img.crossOrigin = cross_origin; |
+ } |
+ img.src = url; |
+ }); |
+} |
</script> |