<!DOCTYPE html>
<body>
<script src="/js-test-resources/js-test.js"></script>
<iframe id='iframe'></iframe>
<script>
description("Test that resources with fragment identifiers are loaded only once.");
window.jsTestIsAsync = true;
function CallCommand(cmd)
{
try {
var req = new XMLHttpRequest;
req.open("GET", "/resources/network-simulator.php?command=" + cmd, false);
req.send(null);
return req.responseText;
} catch (ex) {
return "";
}
}
function getResourceLog()
{
var log = CallCommand("get-resource-request-log");
var logLines = log.split('\n');
debug("Resource Requeset Log:<br>");
debug(logLines.join('<br>'));
}
function finishTest()
{
getResourceLog();
document.body.removeChild(iframe);
CallCommand("clear-resource-request-log");
finishJSTest();
}
CallCommand("start-resource-request-log");
var iframe = document.getElementById("iframe");
iframe.addEventListener('load', function() { setTimeout(finishTest, 0); });
iframe.src = 'resources/subresource-fragment-identifier-iframe.html';
</script>