| OLD | NEW |
| 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 } |
| 11 | 11 |
| 12 if (window.testRunner) { | 12 window.addEventListener('message', function () |
| 13 setTimeout(pollForTest, 1); | 13 { |
| 14 } else { | 14 runTest(); |
| 15 log("To run the test, click the button below when the opened win
dow finishes loading."); | 15 if (window.testRunner) |
| 16 var button = document.createElement("button"); | 16 testRunner.notifyDone(); |
| 17 button.appendChild(document.createTextNode("Run Test")); | 17 }); |
| 18 button.onclick = runTest; | |
| 19 document.body.appendChild(button); | |
| 20 } | |
| 21 } | |
| 22 | |
| 23 pollForTest = function() | |
| 24 { | |
| 25 if (!testRunner.globalFlag) { | |
| 26 setTimeout(pollForTest, 1); | |
| 27 return; | |
| 28 } | |
| 29 runTest(); | |
| 30 testRunner.notifyDone(); | |
| 31 } | 18 } |
| 32 | 19 |
| 33 function customPropertyAccessThrowsException(o) | 20 function customPropertyAccessThrowsException(o) |
| 34 { | 21 { |
| 35 try { | 22 try { |
| 36 var x = o.customProperty; | 23 var x = o.customProperty; |
| 37 return false; | 24 return false; |
| 38 } catch (e) { | 25 } catch (e) { |
| 39 return true; | 26 return true; |
| 40 } | 27 } |
| 41 } | 28 } |
| 42 | 29 |
| 43 runTest = function() | 30 runTest = function() |
| 44 { | 31 { |
| 45 window.targetWindow = frames[0]; | 32 window.targetWindow = frames[0]; |
| 46 | 33 |
| 47 shouldBeTrue("customPropertyAccessThrowsException(targetWindow)"); | 34 shouldBeTrue("customPropertyAccessThrowsException(targetWindow)"); |
| 48 shouldBeTrue("customPropertyAccessThrowsException(targetWindow)"); | 35 shouldBeTrue("customPropertyAccessThrowsException(targetWindow)"); |
| 49 shouldBeTrue("customPropertyAccessThrowsException(targetWindow)"); | 36 shouldBeTrue("customPropertyAccessThrowsException(targetWindow)"); |
| 50 } | 37 } |
| 51 </script> | 38 </script> |
| 52 </head> | 39 </head> |
| 53 <body> | 40 <body> |
| 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> | 41 <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> |
| 55 <iframe src="http://localhost:8000/security/resources/cross-frame-access-get-cus
tom-property-cached-iframe.html" style=""></iframe> | 42 <iframe src="http://localhost:8000/security/resources/cross-frame-access-get-cus
tom-property-cached-iframe.html" style=""></iframe> |
| 56 <pre id="console"></pre> | 43 <pre id="console"></pre> |
| 57 </body> | 44 </body> |
| 58 </html> | 45 </html> |
| OLD | NEW |