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

Unified Diff: LayoutTests/http/tests/security/xssAuditor/resources/utilities.js

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/xssAuditor/resources/utilities.js
diff --git a/LayoutTests/http/tests/security/xssAuditor/resources/utilities.js b/LayoutTests/http/tests/security/xssAuditor/resources/utilities.js
index 7c1ed463089f99959648f33cc49cdfc332b8b0d0..5185d7212f53b64a502b1cdc9811d378ab2cbfbb 100644
--- a/LayoutTests/http/tests/security/xssAuditor/resources/utilities.js
+++ b/LayoutTests/http/tests/security/xssAuditor/resources/utilities.js
@@ -3,14 +3,16 @@ function checkIfFrameLocationMatchesSrcAndCallDone(frameId)
if (!window.testRunner)
return;
- var actualURL = 'unavailable', frame = document.getElementById(frameId);
+ var actualURL = 'unavailable', frame = document.getElementById(frameId);
try {
actualURL = frame.contentWindow.location.href;
- }
- catch (e) {}
-
+ }
+ catch (e) {
+ actualURL = '[Location object access threw exception]';
+ }
+
if (actualURL != frame.src)
- alert('URL mismatch: ' + actualURL + ' vs. ' + frame.src);
+ alert('URL mismatch: \'' + actualURL + '\' vs. \'' + frame.src + '\'');
testRunner.notifyDone();
}

Powered by Google App Engine
This is Rietveld 408576698