Commit 23705631 authored by Matt Falkenhagen's avatar Matt Falkenhagen Committed by Commit Bot

service worker: Upstream sandboxed iframe test to WPT.

This test is a fine subject matter for WPT.

Bug: 486308, 688116
Change-Id: I91d8484286094c695fe2219f0c017e25e8bfd34c
Reviewed-on: https://chromium-review.googlesource.com/759168Reviewed-by: default avatarTsuyoshi Horo <horo@chromium.org>
Commit-Queue: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515030}
parent 8cf24989
...@@ -255,3 +255,13 @@ function register_using_link(script, options) { ...@@ -255,3 +255,13 @@ function register_using_link(script, options) {
}) })
.then(() => navigator.serviceWorker.getRegistration(scope)); .then(() => navigator.serviceWorker.getRegistration(scope));
} }
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);
});
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment