Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <title>Invalid 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 "", | |
| 12 "'foobar'", | |
| 13 "'foobar", | |
| 14 "foobar'", | |
| 15 "foo'bar", | |
| 16 "foob@r", | |
| 17 "foo bar", | |
| 18 ]; | |
| 19 | |
| 20 var iframe; | |
| 21 var i = 0; | |
| 22 function next() { | |
| 23 name = test_suborigin_names[i]; | |
| 24 i++; | |
| 25 iframe.src = "resources/childsuborigin.php?suborigin=" + name; | |
| 26 } | |
| 27 | |
| 28 window.onmessage = function() { | |
| 29 if (i > test_suborigin_names.length) | |
| 30 done(); | |
| 31 | |
| 32 var secret = ''; | |
| 33 try { | |
| 34 secret = iframe.contentWindow.secret; | |
| 35 assert_equals(secret, "I am a secret", "The parent frame should always b e able to get the secret value from the child iframe."); | |
|
Mike West
2015/03/23 07:32:55
Why is this the correct behavior? Why not lock dow
jww
2015/04/11 02:52:35
That's certainly up for debate. I think this is a
| |
| 36 } catch(e) { | |
| 37 assert_unreached(); | |
| 38 }; | |
| 39 next(); | |
| 40 }; | |
| 41 | |
| 42 window.onload = function() {; | |
| 43 iframe = document.getElementById('iframe'); | |
| 44 next(); | |
| 45 }; | |
| 46 </script> | |
| 47 <iframe id="iframe"></iframe> | |
| OLD | NEW |