Index: third_party/WebKit/LayoutTests/presentation/presentation-request-iframe-sandbox-success.html |
diff --git a/third_party/WebKit/LayoutTests/presentation/presentation-request-iframe-sandbox-success.html b/third_party/WebKit/LayoutTests/presentation/presentation-request-iframe-sandbox-success.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f36f587ab7cc531fcea826737bd41b656baf6149 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/presentation/presentation-request-iframe-sandbox-success.html |
@@ -0,0 +1,26 @@ |
+<!DOCTYPE html> |
+<html> |
+<body> |
+<script src="../resources/testharness.js"></script> |
+<script src="../resources/testharnessreport.js"></script> |
+<iframe sandbox="allow-scripts allow-presentation allow-same-origin"></iframe> |
+<script> |
+ |
+var iframe = document.querySelector('iframe'); |
+ |
+async_test(t => { |
+ iframe.onload = t.step_func(() => { |
+ iframe.contentWindow.postMessage('create', '*'); |
+ }); |
+ |
+ window.addEventListener('message', t.step_func_done(e => { |
+ assert_equals(e.data, 'success'); |
+ })); |
+ |
+ // Navigate the iframe |
+ iframe.src = 'resources/iframe-sandbox.html'; |
+}, "Test that creating PresentationRequest succeeds if 'allow-presentation' keyword is present on a sandboxed iframe."); |
+ |
+</script> |
+</body> |
+</html> |