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) |