Index: third_party/WebKit/LayoutTests/http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture.html b/third_party/WebKit/LayoutTests/http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture.html |
index 375c979e37dcce9a6fbf2ff5de3b57963f427790..a244f8a3ee271132b5ccbe70b3d0d551c39b05bc 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture.html |
+++ b/third_party/WebKit/LayoutTests/http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture.html |
@@ -3,6 +3,8 @@ |
<style> |
iframe { width: 400px; height: 200px;} |
</style> |
+ <script src="/resources/testharness.js"></script> |
+ <script src="/resources/testharnessreport.js"></script> |
<script> |
if (window.testRunner) { |
testRunner.dumpAsText(); |
@@ -17,12 +19,17 @@ |
// Because the iframe is cross-origin, it can't get the offsets itself, so leak them. |
frames[0].postMessage({x: iframe.offsetLeft, y: iframe.offsetTop}, "*"); |
} |
+ test(function() { |
+ window.addEventListener("message", e => { |
+ assert_equals(e.data, "PASS", "The message says 'PASS' instead of 'FAIL'"); |
+ }); |
+ }, "The sandboxed iframe posted a message saying the test was in the state of 'PASS'."); |
</script> |
</head> |
<body onload="loaded();"> |
- <p>This tests that an iframe in sandbox with 'allow-top-navigation-with-user-activation' |
+ <p>This tests that an iframe in sandbox with 'allow-top-navigation-by-user-activation' |
can navigate the top level page, if it is trigged by a user gesture.</p> |
<h4>DOMAIN</h4> |
- <iframe id="i" sandbox="allow-scripts allow-top-navigation-with-user-activation" src="http://localhost:8000/security/frameNavigation/resources/iframe-that-performs-parent-navigation.html"></iframe> |
+ <iframe id="i" sandbox="allow-scripts allow-top-navigation-by-user-activation" src="resources/iframe-that-performs-parent-navigation.html"></iframe> |
</body> |
</html> |