| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script> | 3 <script> |
| 4 function CallCommand(cmd) | 4 function CallCommand(cmd) |
| 5 { | 5 { |
| 6 try { | 6 try { |
| 7 var req = new XMLHttpRequest; | 7 var req = new XMLHttpRequest; |
| 8 req.open("GET", "/resources/network-simulator.php?command=" + cmd, false); | 8 req.open("GET", "/resources/network-simulator.php?command=" + cmd, false); |
| 9 req.send(null); | 9 req.send(null); |
| 10 return req.responseText; | 10 return req.responseText; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 var log = CallCommand("get-resource-request-log"); | 35 var log = CallCommand("get-resource-request-log"); |
| 36 var logLines = log.split('\n'); | 36 var logLines = log.split('\n'); |
| 37 logLines.sort(); | 37 logLines.sort(); |
| 38 document.getElementById('result').innerText = logLines.join('\n'); | 38 document.getElementById('result').innerText = logLines.join('\n'); |
| 39 } | 39 } |
| 40 | 40 |
| 41 CallCommand("start-resource-request-log"); | 41 CallCommand("start-resource-request-log"); |
| 42 window.addEventListener('load', startTest, false); | 42 window.addEventListener('load', startTest, false); |
| 43 </script> | 43 </script> |
| 44 | 44 |
| 45 <!-- link rel=subresource is very similar to link rel=prefetch, however it is | |
| 46 expected to have a higher network priority. This test should confirm tha
t the | |
| 47 priorities of the two types of prefetch are being observed --> | |
| 48 | |
| 49 <script> | 45 <script> |
| 50 var linkLoadCount = 5; | 46 var linkLoadCount = 3; |
| 51 | 47 |
| 52 function decrementLinkLoadCount() | 48 function decrementLinkLoadCount() |
| 53 { | 49 { |
| 54 linkLoadCount--; | 50 linkLoadCount--; |
| 55 if (linkLoadCount == 0) { | 51 if (linkLoadCount == 0) { |
| 56 endTest(); | 52 endTest(); |
| 57 } | 53 } |
| 58 } | 54 } |
| 59 </script> | 55 </script> |
| 60 <link rel=prefetch onload="decrementLinkLoadCount()" href="/resources/network-
simulator.php?command=log-resource-request&path=1st.jpg"> | 56 <link rel=prefetch onload="decrementLinkLoadCount()" href="/resources/network-
simulator.php?command=log-resource-request&path=1st.jpg"> |
| 61 <link rel=subresource onload="decrementLinkLoadCount()" href="/resources/netwo
rk-simulator.php?command=log-resource-request&path=2nd.jpg"> | 57 <link rel=prefetch onload="decrementLinkLoadCount()" href="/resources/network-
simulator.php?command=log-resource-request&path=2nd.jpg"> |
| 62 <link rel=prefetch onload="decrementLinkLoadCount()" href="/resources/network-
simulator.php?command=log-resource-request&path=3rd.jpg"> | 58 <link rel=prefetch onload="decrementLinkLoadCount()" href="/resources/network-
simulator.php?command=log-resource-request&path=3rd.jpg"> |
| 63 <link rel=prefetch onload="decrementLinkLoadCount()" href="/resources/network-
simulator.php?command=log-resource-request&path=4th.jpg"> | |
| 64 <link rel=subresource onload="decrementLinkLoadCount()" href="/resources/netwo
rk-simulator.php?command=log-resource-request&path=5th.jpg"> | |
| 65 </head> | 59 </head> |
| 66 <body> | 60 <body> |
| 67 | 61 |
| 68 <div class="box bordered"></div> | 62 <div class="box bordered"></div> |
| 69 | 63 |
| 70 <h2>Resource requests:</h2> | 64 <h2>Resource requests:</h2> |
| 71 <pre id="result">Request log goes here in DRT</pre> | 65 <pre id="result">Request log goes here in DRT</pre> |
| 72 </body> | 66 </body> |
| 73 </html> | 67 </html> |
| OLD | NEW |