blob: fb0d5b2a5c99ffe07ec1d23a2a0ff6bac4d5439b [file] [log] [blame]
cwzwarich@webkit.org78200f52009-03-19 07:55:59 +00001<html>
2<head>
cdumez@apple.com1249ed42016-08-29 19:37:01 +00003 <script src="/js-test-resources/js-test-pre.js"></script>
cwzwarich@webkit.org78200f52009-03-19 07:55:59 +00004 <script src="resources/cross-frame-access.js"></script>
5 <script>
cdumez@apple.com1249ed42016-08-29 19:37:01 +00006 jsTestIsAsync = true;
7
cwzwarich@webkit.org78200f52009-03-19 07:55:59 +00008 window.onload = function()
9 {
rniwa@webkit.orgfc377222012-06-13 09:19:30 +000010 if (window.testRunner) {
cwzwarich@webkit.org78200f52009-03-19 07:55:59 +000011 setTimeout(pollForTest, 1);
12 } else {
13 log("To run the test, click the button below when the opened window finishes loading.");
14 var button = document.createElement("button");
15 button.appendChild(document.createTextNode("Run Test"));
16 button.onclick = runTest;
17 document.body.appendChild(button);
18 }
19 }
20
21 pollForTest = function()
22 {
rniwa@webkit.orgfc377222012-06-13 09:19:30 +000023 if (!testRunner.globalFlag) {
cwzwarich@webkit.org78200f52009-03-19 07:55:59 +000024 setTimeout(pollForTest, 1);
25 return;
26 }
27 runTest();
cdumez@apple.com1249ed42016-08-29 19:37:01 +000028 finishJSTest();
cwzwarich@webkit.org78200f52009-03-19 07:55:59 +000029 }
30
31 function getCustomProperty(o)
32 {
33 return o.customProperty;
34 }
35
36 runTest = function()
37 {
38 window.targetWindow = frames[0];
39
cdumez@apple.com1249ed42016-08-29 19:37:01 +000040 shouldThrowErrorName("getCustomProperty(targetWindow)", "SecurityError");
41 shouldThrowErrorName("getCustomProperty(targetWindow)", "SecurityError");
42 shouldThrowErrorName("getCustomProperty(targetWindow)", "SecurityError");
cwzwarich@webkit.org78200f52009-03-19 07:55:59 +000043 }
44 </script>
45</head>
46<body>
47<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>
48<iframe src="http://localhost:8000/security/resources/cross-frame-access-get-custom-property-cached-iframe.html" style=""></iframe>
49<pre id="console"></pre>
cdumez@apple.com1249ed42016-08-29 19:37:01 +000050<script src="/js-test-resources/js-test-post.js"></script>
cwzwarich@webkit.org78200f52009-03-19 07:55:59 +000051</body>
52</html>