JS Test Harness: Insert the stylesheet dynamically
[WebKit-https.git] / LayoutTests / fast / frames / iframe-no-src-local-origin-allow.html
1 <html>
2 <head>
3 <script src="../js/resources/js-test-pre.js"></script>
4 <script src="../js/resources/js-test-post-function.js"></script>
5 <script>
6 if (window.layoutTestController) {
7     layoutTestController.dumpAsText();
8     layoutTestController.waitUntilDone();
9 }
10
11 var iframeHasLoadedFirstPage = false;
12
13 function runTest()
14 {
15     shouldBe("document.getElementById('theFrame').contentDocument.baseURI", "'about:blank'");
16     var frameDoc = document.getElementById('theFrame').contentWindow.document;
17     var innerFrame = frameDoc.createElement("iframe");
18     innerFrame.src = "resources/iframe-no-src-set-location-pass.html";
19     innerFrame.id = "innerFrame";
20     innerFrame.onload = function() {
21         shouldBe("document.getElementById('theFrame').contentDocument.getElementById('innerFrame').contentDocument.body.innerHTML", "'PASS\\n'");
22         isSuccessfullyParsed();
23         if (window.layoutTestController)
24             layoutTestController.notifyDone();
25     }
26     frameDoc.body.appendChild(innerFrame);
27 }
28
29 </script>
30 </head>
31 <body>
32 <script>
33 description("This tests that an iframe with no src attribute uses the parent document's origin when resolving links inserted into the frame via JavaScript.");
34 var successfullyParsed = true;
35 </script>
36 <iframe id="theFrame" onload="runTest()"></iframe>
37 </body>
38 </html>