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

Side by Side Diff: LayoutTests/http/tests/security/cross-frame-access-get-custom-property-cached.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 src="resources/cross-frame-access.js"></script> 3 <script src="resources/cross-frame-access.js"></script>
4 <script> 4 <script>
5 window.onload = function() 5 window.onload = function()
6 { 6 {
7 if (window.testRunner) { 7 if (window.testRunner) {
8 testRunner.dumpAsText(); 8 testRunner.dumpAsText();
9 testRunner.waitUntilDone(); 9 testRunner.waitUntilDone();
10 } 10 }
(...skipping 12 matching lines...) Expand all
23 pollForTest = function() 23 pollForTest = function()
24 { 24 {
25 if (!testRunner.globalFlag) { 25 if (!testRunner.globalFlag) {
26 setTimeout(pollForTest, 1); 26 setTimeout(pollForTest, 1);
27 return; 27 return;
28 } 28 }
29 runTest(); 29 runTest();
30 testRunner.notifyDone(); 30 testRunner.notifyDone();
31 } 31 }
32 32
33 function getCustomProperty(o) 33 function customPropertyAccessThrowsException(o)
34 { 34 {
35 return o.customProperty; 35 try {
36 var x = o.customProperty;
37 return false;
38 } catch (e) {
39 return true;
40 }
36 } 41 }
37 42
38 runTest = function() 43 runTest = function()
39 { 44 {
40 window.targetWindow = frames[0]; 45 window.targetWindow = frames[0];
41 46
42 shouldBeUndefined("getCustomProperty(targetWindow)"); 47 shouldBeTrue("customPropertyAccessThrowsException(targetWindow)");
43 shouldBeUndefined("getCustomProperty(targetWindow)"); 48 shouldBeTrue("customPropertyAccessThrowsException(targetWindow)");
44 shouldBeUndefined("getCustomProperty(targetWindow)"); 49 shouldBeTrue("customPropertyAccessThrowsException(targetWindow)");
45 } 50 }
46 </script> 51 </script>
47 </head> 52 </head>
48 <body> 53 <body>
49 <p>This test checks that caching of property accesses doesn't allow for illegal cross-frame access of a custom property. It also checks for an assertion failure that once occurred in this situation.</p> 54 <p>This test checks that caching of property accesses doesn't allow for illegal cross-frame access of a custom property. It also checks for an assertion failure that once occurred in this situation.</p>
50 <iframe src="http://localhost:8000/security/resources/cross-frame-access-get-cus tom-property-cached-iframe.html" style=""></iframe> 55 <iframe src="http://localhost:8000/security/resources/cross-frame-access-get-cus tom-property-cached-iframe.html" style=""></iframe>
51 <pre id="console"></pre> 56 <pre id="console"></pre>
52 </body> 57 </body>
53 </html> 58 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698