OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
| 4 <meta charset="utf-8"> |
4 <script src="/resources/testharness.js"></script> | 5 <script src="/resources/testharness.js"></script> |
5 <script src="/resources/testharnessreport.js"></script> | 6 <script src="/resources/testharnessreport.js"></script> |
6 </head> | 7 </head> |
7 <body> | 8 <body> |
8 <script> | 9 <script> |
9 var test_suborigin_options = [ | 10 var test_suborigin_options = [ |
10 [ "foobar '", "Single quote as option" ], | 11 [ 'foobar \'', 'Single quote as option' ], |
11 [ "foobar 'unsafe-postmessage-send';", "Character after single policy" ], | 12 [ 'foobar \'unsafe-postmessage-send\';', 'Character after single policy' ], |
12 [ "foobar 'unsafe-postmessage-send'; 'unsafe-cookies';", "Charecters after m
ultiple policies" ], | 13 [ 'foobar \'unsafe-postmessage-send\'; \'unsafe-cookies\';', |
13 [ "foobar; 'unsafe-postmessage-send'", "Character before policy" ], | 14 'Charecters after multiple policies' ], |
14 [ "foobar 'b@d character$'", "Bad characters in option" ], | 15 [ 'foobar; \'unsafe-postmessage-send\'', 'Character before policy' ], |
| 16 [ 'foobar \'b@d character$\'', 'Bad characters in option' ], |
15 ]; | 17 ]; |
16 | 18 |
17 for (option in test_suborigin_options) { | 19 for (option in test_suborigin_options) { |
18 async_test(t => { | 20 async_test(t => { |
19 var id = option; | 21 var id = option; |
20 var iframe; | 22 var iframe; |
21 window.addEventListener('message', t.step_func(event => { | 23 window.addEventListener('message', t.step_func(event => { |
22 if (event.source != iframe.contentWindow) | 24 if (event.source != iframe.contentWindow) |
23 return; | 25 return; |
24 | 26 |
25 assert_equals(event.data, "I am a secret"); | 27 assert_equals(event.data, 'I am a secret'); |
26 t.done(); | 28 t.done(); |
27 })); | 29 })); |
28 iframe = document.createElement('iframe'); | 30 iframe = document.createElement('iframe'); |
29 iframe.setAttribute('src', "resources/reach-into-iframe.php?childsuborig
in=" + test_suborigin_options[id][0]); | 31 iframe.setAttribute('src', |
30 document.body.appendChild(iframe); | 32 'resources/reach-into-iframe.php?childsuborigin=' + |
| 33 test_suborigin_options[id][0]); |
| 34 document.body.appendChild(iframe); |
31 }, test_suborigin_options[option][1]); | 35 }, test_suborigin_options[option][1]); |
32 } | 36 } |
33 </script> | 37 </script> |
34 </body> | 38 </body> |
35 </html> | 39 </html> |
OLD | NEW |