Index: LayoutTests/fast/frames/sandboxed-iframe-history-denied.html |
diff --git a/LayoutTests/fast/frames/sandboxed-iframe-history-denied.html b/LayoutTests/fast/frames/sandboxed-iframe-history-denied.html |
index 007fff3d7faaccccd2d57caa87a46ec0abd9ed0a..7a67c791874ad4dd0d2fa3fccf65885a75b9f960 100644 |
--- a/LayoutTests/fast/frames/sandboxed-iframe-history-denied.html |
+++ b/LayoutTests/fast/frames/sandboxed-iframe-history-denied.html |
@@ -6,27 +6,15 @@ if (window.testRunner) { |
testRunner.waitUntilDone(); |
} |
-window.unload = function() { |
- alert("FAIL"); |
-} |
- |
-window.onload = function() { |
- // There's no way to write a test that determinstically fails because the |
- // history API is asynchronous. There's no way to know whether the |
- // asynchronous haven't yet happened or never will. Consequently, we just |
- // wait for a bit. |
- setTimeout(function() { |
- alert("PASS"); |
- if (window.testRunner) |
- testRunner.notifyDone(); |
- }, 20); |
+function loaded() { |
+ if (window.testRunner) |
+ testRunner.notifyDone(); |
} |
</script> |
</head> |
<body> |
-<p>This test verifies that a sandboxed IFrame cannot navigate the top-level frame using the history API.</p> |
-<iframe sandbox="allow-scripts" src="data:text/html,<script>top.history.back()</script>"> |
-<iframe sandbox="allow-scripts" src="data:text/html,<script>top.history.forward()</script>"> |
-<iframe sandbox="allow-scripts" src="data:text/html,<script>top.history.go(-1)</script>"> |
+ <p>This test verifies that a sandboxed IFrame cannot access the history object of the top-level frame. |
+ It passes if a console error is present, noting that the inner frame cannot access the outer.</p> |
+<iframe sandbox="allow-scripts" src="data:text/html,<script>top.history</script>" onload="loaded()"> |
</body> |
</html> |