|
1 <html> |
|
2 <head> |
|
3 <title>X-Frame-Options tests</title> |
|
4 <script type="text/javascript"> |
|
5 // This frame loading means all subframes have either loaded or errored out. We |
|
6 // can now tell the test harness to check each subframe for the expected result. |
|
7 window.addEventListener('load', parent.testFramesLoaded, false); |
|
8 </script> |
|
9 </head> |
|
10 <body> |
|
11 |
|
12 <iframe id="control1" src="http://mochi.test:8888/tests/content/base/test/file_x-frame-options_page.sjs?testid=control1"></iframe><br> |
|
13 <iframe id="control2" src="http://example.com/tests/content/base/test/file_x-frame-options_page.sjs?testid=control2"></iframe><br> |
|
14 <iframe id="deny" src="http://mochi.test:8888/tests/content/base/test/file_x-frame-options_page.sjs?testid=deny&xfo=deny"></iframe><br> |
|
15 <iframe id="sameorigin1" src="http://mochi.test:8888/tests/content/base/test/file_x-frame-options_page.sjs?testid=sameorigin1&xfo=sameorigin"></iframe><br> |
|
16 <iframe id="sameorigin2" src="http://example.com/tests/content/base/test/file_x-frame-options_page.sjs?testid=sameorigin2&xfo=sameorigin"></iframe><br> |
|
17 <iframe id="sameorigin5" src="http://example.com/tests/content/base/test/file_x-frame-options_page.sjs?testid=sameorigin5&xfo=sameorigin2"></iframe><br> |
|
18 <iframe id="sameorigin6" src="http://mochi.test:8888/tests/content/base/test/file_x-frame-options_page.sjs?testid=sameorigin6&xfo=sameorigin2"></iframe><br> |
|
19 <iframe id="sameorigin7" src="http://mochi.test:8888/tests/content/base/test/file_x-frame-options_page.sjs?testid=sameorigin7&xfo=sameorigin3"></iframe><br> |
|
20 <iframe id="sameorigin8" src="http://example.com/tests/content/base/test/file_x-frame-options_page.sjs?testid=sameorigin8&xfo=sameorigin3"></iframe><br> |
|
21 <iframe id="mixedpolicy" src="http://mochi.test:8888/tests/content/base/test/file_x-frame-options_page.sjs?testid=mixedpolicy&xfo=mixedpolicy"></iframe><br> |
|
22 <iframe id="allow-from-allow" src="http://example.com/tests/content/base/test/file_x-frame-options_page.sjs?testid=allow-from-allow&xfo=afa"></iframe><br> |
|
23 <iframe id="allow-from-deny" src="http://example.com/tests/content/base/test/file_x-frame-options_page.sjs?testid=allow-from-deny&xfo=afd"></iframe><br> |
|
24 <iframe id="sameorigin-multipart" src="http://example.com/tests/content/base/test/file_x-frame-options_page.sjs?testid=sameorigin-multipart&xfo=sameorigin&multipart=1"></iframe><br> |
|
25 <iframe id="sameorigin-multipart2" src="http://mochi.test:8888/tests/content/base/test/file_x-frame-options_page.sjs?testid=sameorigin-multipart2&xfo=sameorigin&multipart=1"></iframe><br> |
|
26 |
|
27 <!-- added for bug 836132 --> |
|
28 <script type="text/javascript"> |
|
29 |
|
30 function addFrame(test, xfo) { |
|
31 var baseurl = "http://mochi.test:8888/tests/content/base/test/file_x-frame-options_page.sjs"; |
|
32 var ifr = "<iframe id='" + test + "'" + "src='" + baseurl + "?testid=" + test + "&xfo=" + xfo + "' style='border:2px solid red;'></iframe>"; |
|
33 document.write(ifr); |
|
34 } |
|
35 |
|
36 addFrame("allow-from-allow-1", "afa1"); |
|
37 for (var i = 1; i<=14; i++) |
|
38 addFrame("allow-from-deny-"+i, "afd"+i); |
|
39 |
|
40 </script> |
|
41 |
|
42 |
|
43 </body> |
|
44 </html> |