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

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

Issue 220563002: Remove HTMLFrameElement.location (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix tests Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script>
4 if (window.testRunner) {
5 testRunner.dumpAsText();
6 testRunner.dumpChildFramesAsText();
7 testRunner.waitUntilDone();
8 }
9
10 window.addEventListener('message', function() {
11 runTest();
12 if (window.testRunner)
13 testRunner.notifyDone();
14 });
15
16 window.onerror = function (msg) {
17 var jsErrorMessage = 'Uncaught SecurityError: Failed to set the \'lo cation\' property on \'HTMLFrameElement\': Blocked a frame with origin "http://1 27.0.0.1:8000" from accessing a cross-origin frame.';
18 if (msg == jsErrorMessage)
19 console.log("PASS: Exception was '" + msg + "'.");
20 else
21 console.log("FAIL: Exception should have been '" + jsErrorMessag e + "', was '" + msg + "'.");
22
23 if (window.testRunner)
24 setTimeout(testRunner.notifyDone.bind(testRunner), 0);
25
26 return false; // Don't handle the exception to ensure it shows up in the console.
27 };
28
29 function runTest() {
30 var frame = document.getElementById('aFrame');
31 frame.location = 'javascript:"FAIL: this should not have been loaded ."';
32 }
33 </script>
34 </head>
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 rep orted to the console has unsanitized detail.</p>">
37 <frame id='aFrame' name="aFrame" src='http://localhost:8000/security/resourc es/cross-frame-iframe.html'>
38 </frameset>
39 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698