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

Side by Side Diff: LayoutTests/http/tests/history/cross-origin-replace-history-object-child.html

Issue 19932002: Throw exceptions on all failed cross-origin access checks. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: test. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script> 3 <script>
4 4
5 if (window.testRunner) { 5 if (window.testRunner) {
6 testRunner.dumpAsText(); 6 testRunner.dumpAsText();
7 testRunner.waitUntilDone(); 7 testRunner.waitUntilDone();
8 } 8 }
9 9
10 window.onmessage = function(evt) 10 window.onmessage = function(evt)
11 { 11 {
12 if (evt.data != "done") { 12 if (evt.data != "done") {
13 alert("Unexpected message: " + evt.data); 13 alert("Unexpected message: " + evt.data);
14 testRunner.notifyDone(); 14 testRunner.notifyDone();
15 return; 15 return;
16 } 16 }
17 17 try {
18 alert("Child window's history object after attempt to clear: " + window.fram es[0].history); 18 alert("Child window's history object after attempt to clear: " + window. frames[0].history);
19 } catch (e) {
20 alert("PASS: Access to window.frames[0].history threw an exception.");
21 }
19 testRunner.notifyDone(); 22 testRunner.notifyDone();
20 } 23 }
21 24
22 function setHistoryLength() 25 function setHistoryLength()
23 { 26 {
24 alert("Child window's history object before attempt to clear: " + window.fra mes[0].history); 27 try {
28 alert("Child window's history object before attempt to clear: " + window .frames[0].history);
29 } catch (e) {
30 alert("PASS: Access to window.frames[0].history threw an exception.");
31 }
25 window.frames[0].postMessage("setHistoryLength", "*"); 32 window.frames[0].postMessage("setHistoryLength", "*");
26 } 33 }
27 34
28 </script> 35 </script>
29 </head> 36 </head>
30 <body onload="setHistoryLength();"> 37 <body onload="setHistoryLength();">
31 <iframe id='testFrame' src="http://localhost:8000/history/resources/cross-origin -replaces-history-object-child-iframe.html"></iframe> 38 <iframe id='testFrame' src="http://localhost:8000/history/resources/cross-origin -replaces-history-object-child-iframe.html"></iframe>
32 </body> 39 </body>
33 </html> 40 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698