Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Unified Diff: LayoutTests/http/tests/security/sandboxed-iframe-blocks-access-from-parent.html

Issue 19095003: Throw 'SecurityError' upon cross-origin Location access. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaseline. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/security/sandboxed-iframe-blocks-access-from-parent.html
diff --git a/LayoutTests/http/tests/security/sandboxed-iframe-blocks-access-from-parent.html b/LayoutTests/http/tests/security/sandboxed-iframe-blocks-access-from-parent.html
index 42a684df94da8a8b05905117dd94dd80092e34b7..7058e650fb38efa4c97067a13a3cfae940f789ad 100644
--- a/LayoutTests/http/tests/security/sandboxed-iframe-blocks-access-from-parent.html
+++ b/LayoutTests/http/tests/security/sandboxed-iframe-blocks-access-from-parent.html
@@ -9,15 +9,19 @@
function test() {
var test = document.getElementById('testframe');
- var location = test.contentWindow.location.href;
+ try {
+ var location = test.contentWindow.location.href;
+ } catch (e) {
+ alert("PASS: Cross-origin access to the Location object threw an exception.");
+ }
}
</script>
</head>
<body>
<p>Sandboxing a frame puts it into a unique origin by default, which the
- containing document shouldn't have script access to. This test passes if a
- console warning is generated, noting the access violation.</p>
+ containing document shouldn't have script access to. This test passes if an
+ exception is thrown upon the access violation.</p>
<iframe src="resources/blank.html" id="testframe" sandbox onload="test();"></iframe>
</body>

Powered by Google App Engine
This is Rietveld 408576698