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 a CSP header added by a 304 response does not ov
erride one from the original request.'); | 6 description('Check that a CSP header added by a 304 response does not ov
erride one from the original request.'); |
7 window.jsTestIsAsync = true; | 7 window.jsTestIsAsync = true; |
8 | 8 |
9 var frame1, frame2; | 9 var frame1, frame2; |
10 function frameLoaded() { | 10 function frameLoaded() { |
11 frame1 = document.querySelector('iframe'); | 11 frame1 = document.querySelector('iframe'); |
12 | 12 |
13 frame2 = document.createElement('iframe'); | 13 frame2 = document.createElement('iframe'); |
14 document.body.appendChild(frame2); | 14 document.body.appendChild(frame2); |
15 frame2.onload = checkState; | 15 frame2.onload = checkState; |
16 | 16 |
17 frame2.src = frame1.src; | 17 frame2.src = frame1.src; |
18 } | 18 } |
19 | 19 |
20 function checkState() { | 20 function checkState() { |
21 debug('Check that the nonce is the same, meaning that the document w
as only generated once:'); | 21 debug('Check that the nonce is the same, meaning that the document w
as only generated once:'); |
22 | 22 |
23 shouldBeTrue('frame1.contentDocument.querySelector("input").value ==
frame2.contentDocument.querySelector("input").value'); | 23 shouldBeTrue('frame1.contentDocument.querySelector("input").value ==
frame2.contentDocument.querySelector("input").value'); |
24 finishJSTest(); | 24 finishJSTest(); |
25 } | 25 } |
26 </script> | 26 </script> |
27 <script src="/js-test-resources/js-test-post.js"></script> | |
28 </head> | 27 </head> |
29 <body> | 28 <body> |
30 <iframe src="http://127.0.0.1:8000/security/contentSecurityPolicy/resources/
nph-cached-csp.pl" onload="frameLoaded()"></iframe> | 29 <iframe src="http://127.0.0.1:8000/security/contentSecurityPolicy/resources/
nph-cached-csp.pl" onload="frameLoaded()"></iframe> |
31 </body> | 30 </body> |
32 </html> | 31 </html> |
OLD | NEW |