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

Unified Diff: LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-location-htmldom.html

Issue 22829002: Throw an exception when denying access to 'Frame's 'location' setter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 7 years, 4 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/javascriptURL/javascriptURL-execution-context-frame-location-htmldom.html
diff --git a/LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-location-htmldom.html b/LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-location-htmldom.html
index 1ee1d7e1a138fec41e719aab869696c58fbca264..caf3acf642a5104eb97e94247be14e35a17c1bcb 100644
--- a/LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-location-htmldom.html
+++ b/LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-location-htmldom.html
@@ -25,15 +25,23 @@
runTest();
testRunner.notifyDone();
}
+
+ setFrameLocation = function(url) {
+ var frame = document.getElementById('aFrame');
+ try {
+ frame.location = url;
+ } catch (e) {
+ console.log("Caught exception while setting frame's location to '" + url + "'. '" + e + "'.");
+ }
+ }
runTest = function()
{
- var frame = document.getElementById('aFrame');
- frame.location = 'javascript:"FAIL: this should not have been loaded."';
- frame.location = ' javascript:"FAIL: this should not have been loaded."';
- frame.location = 'java\0script:"FAIL: this should not have been loaded."';
- frame.location = 'javascript\t:"FAIL: this should not have been loaded."';
- frame.location = 'javascript\1:"FAIL: this should not have been loaded."';
+ setFrameLocation('javascript:"FAIL: this should not have been loaded."');
+ setFrameLocation(' javascript:"FAIL: this should not have been loaded."');
+ setFrameLocation('java\0script:"FAIL: this should not have been loaded."');
+ setFrameLocation('javascript\t:"FAIL: this should not have been loaded."');
+ setFrameLocation('javascript\1:"FAIL: this should not have been loaded."');
}
</script>
</head>

Powered by Google App Engine
This is Rietveld 408576698