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