OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <title>Valid suborigin names</title> |
| 5 <script src="/resources/testharness.js"></script> |
| 6 <script src="/resources/testharnessreport.js"></script> |
| 7 </head> |
| 8 |
| 9 <script> |
| 10 var test_suborigin_names = [ |
| 11 "foobar", |
| 12 "foob4r", |
| 13 "Foobar", |
| 14 "FOOBAR", |
| 15 "42", |
| 16 ]; |
| 17 |
| 18 var iframe; |
| 19 var i = 0; |
| 20 function next() { |
| 21 name = test_suborigin_names[i]; |
| 22 i++; |
| 23 iframe.src = "resources/childsuborigin.php?suborigin=" + name; |
| 24 } |
| 25 |
| 26 window.onmessage = function() { |
| 27 if (i > test_suborigin_names.length) |
| 28 done(); |
| 29 |
| 30 var secret = ''; |
| 31 try { |
| 32 secret = iframe.contentWindow.secret; |
| 33 assert_unreached(); |
| 34 } catch(e) { |
| 35 assert_equals(secret, "", "The parent frame should never be able to get
the secret value from the child iframe."); |
| 36 }; |
| 37 next(); |
| 38 }; |
| 39 |
| 40 window.onload = function() {; |
| 41 iframe = document.getElementById('iframe'); |
| 42 next(); |
| 43 }; |
| 44 </script> |
| 45 <iframe id="iframe"></iframe> |
OLD | NEW |