Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / cache / subresource-fragment-identifier.html
blobdd24771e61b28ddd78056de8f50563388e577358
1 <!DOCTYPE html>
2 <body>
3 <script src="/js-test-resources/js-test.js"></script>
4 <iframe id='iframe'></iframe>
5 <script>
6 description("Test that resources with fragment identifiers are loaded only once.");
8 window.jsTestIsAsync = true;
10 function CallCommand(cmd)
12 try {
13 var req = new XMLHttpRequest;
14 req.open("GET", "/resources/network-simulator.php?command=" + cmd, false);
15 req.send(null);
16 return req.responseText;
17 } catch (ex) {
18 return "";
22 function getResourceLog()
24 var log = CallCommand("get-resource-request-log");
25 var logLines = log.split('\n');
26 debug("Resource Requeset Log:<br>");
27 debug(logLines.join('<br>'));
30 function finishTest()
32 getResourceLog();
33 document.body.removeChild(iframe);
34 CallCommand("clear-resource-request-log");
35 finishJSTest();
38 CallCommand("start-resource-request-log");
39 var iframe = document.getElementById("iframe");
40 iframe.addEventListener('load', function() { setTimeout(finishTest, 0); });
41 iframe.src = 'resources/subresource-fragment-identifier-iframe.html';
42 </script>