4 if (window.testRunner) {
5 testRunner.dumpAsText();
6 testRunner.dumpChildFramesAsText();
7 testRunner.waitUntilDone();
10 window.addEventListener('message', function() {
12 if (window.testRunner)
13 testRunner.notifyDone();
16 window.onerror = function (msg) {
17 var jsErrorMessage = 'Uncaught SecurityError: Failed to set the \'location\' property on \'HTMLFrameElement\': Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame.';
18 if (msg == jsErrorMessage)
19 console.log("PASS: Exception was '" + msg + "'.");
21 console.log("FAIL: Exception should have been '" + jsErrorMessage + "', was '" + msg + "'.");
23 if (window.testRunner)
24 setTimeout(testRunner.notifyDone.bind(testRunner), 0);
26 return false; // Don't handle the exception to ensure it shows up in the console.
30 var frame = document.getElementById('aFrame');
31 frame.location = 'javascript:"FAIL: this should not have been loaded."';
35 <frameset rows="10%,*">
36 <frame id='main' name='main' src="data:text/html,<p>This test passes as long as the onerror handler logs PASS to the console, and the uncaught exception reported to the console has unsanitized detail.</p>">
37 <frame id='aFrame' name="aFrame" src='http://localhost:8000/security/resources/cross-frame-iframe.html'>