Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / detaching-frame-2.html
blob02d39ede3aaa91ebb4f0ff794de2323a280bee57
1 <!doctype html>
2 <body onload="test()">
3 <p><a href="https://bugs.webkit.org/show_bug.cgi?id=25420">bug 25240</a></p>
4 <script>
5 if (window.testRunner) {
6 testRunner.dumpAsText()
7 testRunner.waitUntilDone()
10 function test() {
11 try {
12 window.x = frames[0].XMLHttpRequest
13 } catch(e) { alert(e) }
15 frames[0].frameElement.onload = function() {
16 var client
17 try {
18 client = new window.x()
19 client.open("GET", "/xmlhttprequest/resources/echo-host.php", false)
20 client.send("")
21 } catch(e)
24 // FAIL if loaded data from another domain.
25 document.getElementById("result").innerHTML = (client && client.responseText.match(/localhost/)) ? "FAIL" : "PASS"
26 if (window.testRunner)
27 testRunner.notifyDone()
29 frames[0].location = frames[0].location.toString().replace("127.0.0.1", "localhost")
31 </script>
32 <iframe src="resources/echo-host.php"></iframe>
33 <div id=result>FAIL: Script did not run.</div>
34 </body>