27976b09e851bfb88e23756ee3ba55bdee532ff8
[WebKit-https.git] / LayoutTests / http / tests / security / frame-loading-via-document-write.html
1 <html>
2 <head>
3
4 <script language="JavaScript">
5
6 function buildFrameset()
7 {
8     if (window.layoutTestController)
9         layoutTestController.waitUntilDone();
10
11     var outHTML="<frameset rows=\"33%, 33%, 33%\">"+
12                 "<frame src=\"\" name=\"topRow\">"+
13                 "<frame src=\"\" name=\"middleRow\">"+
14                 "<frame src=\"\" name=\"bottomRow\">"+
15                 "</frameset>";
16
17     document.open("text/html","replace");
18     document.write(outHTML);
19     document.close();
20
21     outHTML = "<html><head><scr" + "ipt language=\"JavaScript\" src=\"resources/frame-loading-via-document-write.js\">"+
22               "</scr" + "ipt></head><body onLoad=\"clickAnchor()\"><table><tr><td>"+
23               "<a href=\"resources/success.html\" target=\"topRow\" id=\"anchorLink\">Click me. If nothing loads above we have a problem.</a>"+
24               "</td></tr></table></body></html>";
25
26     frames['topRow'].document.open("text/html","replace");
27     frames['topRow'].document.charset=document.charset;
28     frames['topRow'].document. write(outHTML);
29     frames['topRow'].document.close();
30
31     outHTML = "<html><head><scr" + "ipt language=\"JavaScript\" src=\"resources/frame-loading-via-document-write.js\">"+
32               "</scr" + "ipt></head><body onLoad=\"didImageLoad()\"><table><tr><td>"+
33               "<div id=\"result\"></div>"+
34               "<img src=\"file:////tmp/LayoutTests/fast/dom/resources/abe.png\" id=\"myImg\">"+
35               "</td></tr></table></body></html>";
36
37     frames['middleRow'].document.open("text/html","replace");
38     frames['middleRow'].document.charset=document.charset;
39     frames['middleRow'].document. write(outHTML);
40     frames['middleRow'].document.close();
41
42     outHTML = "<html><head><scr" + "ipt language=\"JavaScript\" src=\"resources/frame-loading-via-document-write.js\">"+
43               "</scr" + "ipt></head><body onLoad=\"lastTest()\"><table><tr><td>"+
44               "<div id=\"result\"></div>"+
45               "<img src=\"/resources/abe.png\" id=\"myImg\">"+
46               "</td></tr></table></body></html>";
47
48     frames['bottomRow'].document.open("text/html","replace");
49     frames['bottomRow'].document.charset=document.charset;
50     frames['bottomRow'].document. write(outHTML);
51     frames['bottomRow'].document.close();
52 }
53
54 buildFrameset();
55
56 </script>
57 </head>
58
59 <body>
60 <p>JavaScript FAILED! you should not see this.</p>
61 </body>
62
63 </html>
64