Link prefetch not useful for top-level navigation
[WebKit-https.git] / LayoutTests / http / tests / cache / link-prefetch-main-resource-iframe.html
1 <html>
2 <body>
3 <div id="result"></div>
4 <script>
5
6 if (window.testRunner) {
7     testRunner.dumpAsText();
8     testRunner.waitUntilDone();
9 }
10
11 function done()
12 {
13     testRunner.notifyDone();
14 }
15
16 function iframeLoadFinished()
17 {
18     if (window.testRunner)
19         setTimeout(done, 0);
20 }
21
22 function loadAfterPrefetch()
23 {
24     var newIframe = document.createElement("iframe");
25     newIframe.src = "http://localhost:8000/cache/resources/prefetched-main-resource-iframe.php";
26     newIframe.onload = iframeLoadFinished;
27     document.body.appendChild(newIframe);
28 }
29
30 window.onmessage = function(message)
31 {
32     document.getElementById('result').textContent = message.data;
33 }
34
35 </script>
36 <link rel="prefetch" href="http://localhost:8000/cache/resources/prefetched-main-resource-iframe.php" onload="setTimeout(loadAfterPrefetch, 0);">
37 </body>
38 </html>