Index: LayoutTests/http/tests/serviceworker/resources/test-helpers.js |
diff --git a/LayoutTests/http/tests/serviceworker/resources/test-helpers.js b/LayoutTests/http/tests/serviceworker/resources/test-helpers.js |
index 1748c4994f041a5a6aecf75788f0ccb0a812ad1d..2a8e7122565b9f9b7ed39d424b7d3f284bc56c5f 100644 |
--- a/LayoutTests/http/tests/serviceworker/resources/test-helpers.js |
+++ b/LayoutTests/http/tests/serviceworker/resources/test-helpers.js |
@@ -55,6 +55,16 @@ function with_iframe(url) { |
}); |
} |
+function with_sandboxed_iframe(url, sandbox) { |
+ return new Promise(function(resolve) { |
+ var frame = document.createElement('iframe'); |
+ frame.sandbox = sandbox; |
+ frame.src = url; |
+ frame.onload = function() { resolve(frame); }; |
+ document.body.appendChild(frame); |
+ }); |
+} |
+ |
function normalizeURL(url) { |
return new URL(url, self.location).toString().replace(/#.*$/, ''); |
} |