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

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

Issue 2425663002: Add an error page for resources blocked via XSS Auditor. (Closed)
Patch Set: Test. Created 4 years, 1 month 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: third_party/WebKit/LayoutTests/http/tests/security/xssAuditor/resources/utilities.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/xssAuditor/resources/utilities.js b/third_party/WebKit/LayoutTests/http/tests/security/xssAuditor/resources/utilities.js
index 34ec6b8f97b033b977c8768bcddadf06b20a1c39..a85d09cab0d6d9d1a3b707ccee97601f04068972 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/xssAuditor/resources/utilities.js
+++ b/third_party/WebKit/LayoutTests/http/tests/security/xssAuditor/resources/utilities.js
@@ -17,6 +17,23 @@ function checkIfFrameLocationMatchesSrcAndCallDone(frameId)
testRunner.notifyDone();
}
+function checkFrameIsCrossOriginAndCallDone(frameId) {
+ if (!window.testRunner)
+ return;
+
+ var actualURL = 'unavailable', frame = document.getElementById(frameId);
+ try {
+ actualURL = frame.contentWindow.location.href;
+ console.log('FAIL: "' + frameId + '" loaded "' + actualURL + '".');
+ }
+ catch (e) {
+ actualURL = '[Location object access threw exception]';
+ console.log('PASS: "' + frameId + '" is cross-origin.');
+ }
+
+ testRunner.notifyDone();
+}
+
function sendRequestFromIFrame(url, params, HTTPMethod, callbackWhenDone)
{
if (!params || !params.length)

Powered by Google App Engine
This is Rietveld 408576698