OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="/js-test-resources/js-test-pre.js"></script> | 4 <script src="/js-test-resources/js-test-pre.js"></script> |
5 <script> | 5 <script> |
6 description('Check that an X-Frame-Options header added by a 304 respons
e does not override one from the original request.'); | 6 description('Check that an X-Frame-Options header added by a 304 respons
e does not override one from the original request.'); |
7 debug('Two console messages should be generated, each followed by an ale
rt.'); | 7 debug('Two console messages should be generated, each followed by an ale
rt.'); |
8 window.jsTestIsAsync = true; | 8 window.jsTestIsAsync = true; |
9 | 9 |
10 var frame1, frame2; | 10 var frame1, frame2; |
11 function frameLoaded() { | 11 function frameLoaded() { |
12 frame1 = document.querySelector('iframe'); | 12 frame1 = document.querySelector('iframe'); |
13 | 13 |
14 frame2 = document.createElement('iframe'); | 14 frame2 = document.createElement('iframe'); |
15 document.body.appendChild(frame2); | 15 document.body.appendChild(frame2); |
16 frame2.onload = checkState; | 16 frame2.onload = checkState; |
17 | 17 |
18 frame2.src = frame1.src; | 18 frame2.src = frame1.src; |
19 } | 19 } |
20 | 20 |
21 function checkState() { | 21 function checkState() { |
22 debug('Both frames should point to the expected URL, and not to abou
t:blank.'); | 22 debug('Both frames should point to the expected URL, and not to abou
t:blank.'); |
23 shouldBeEqualToString('frame1.src', 'http://127.0.0.1:8000/security/
XFrameOptions/resources/nph-cached-xfo.pl'); | 23 shouldBeEqualToString('frame1.src', 'http://127.0.0.1:8000/security/
XFrameOptions/resources/nph-cached-xfo.pl'); |
24 shouldBeEqualToString('frame2.src', 'http://127.0.0.1:8000/security/
XFrameOptions/resources/nph-cached-xfo.pl'); | 24 shouldBeEqualToString('frame2.src', 'http://127.0.0.1:8000/security/
XFrameOptions/resources/nph-cached-xfo.pl'); |
25 finishJSTest(); | 25 finishJSTest(); |
26 } | 26 } |
27 </script> | 27 </script> |
28 <script src="/js-test-resources/js-test-post.js"></script> | |
29 </head> | 28 </head> |
30 <body> | 29 <body> |
31 <iframe src="http://127.0.0.1:8000/security/XFrameOptions/resources/nph-cach
ed-xfo.pl" onload="frameLoaded()"></iframe> | 30 <iframe src="http://127.0.0.1:8000/security/XFrameOptions/resources/nph-cach
ed-xfo.pl" onload="frameLoaded()"></iframe> |
32 </body> | 31 </body> |
33 </html> | 32 </html> |
OLD | NEW |