blob: ceb3eef9e69a42039a9da06c9c4dd0b63e6bf7bb [file] [log] [blame]
<head>
<script>
var watchdog;
function logResult(result)
{
document.getElementById("result").appendChild(document.createTextNode(result));
if (window.layoutTestController)
layoutTestController.notifyDone();
}
function subframeLoaded()
{
if (watchdog) {
clearTimeout(watchdog);
logResult("SUCCESS: The subframe loaded.");
}
}
function watchdogFired()
{
logResult("FAILURE: The subframe did not load within 100 ms.");
}
function runTest()
{
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}
var subframeLocation = window.location + "";
subframeLocation = subframeLocation.replace(/file:\/\/\//, "file://:1/");
subframeLocation = subframeLocation.replace(/file-URL-with-port-number/, "resources/empty-subframe");
document.getElementById("subframe").contentWindow.location = subframeLocation;
watchdog = setTimeout(watchdogFired, 100);
}
</script>
</head>
<body onload="runTest()">
<p>This tests whether we can load a file URL with a port number in the URL. It should be ignored, and so the load should succeed.</p>
<p id="result"></p>
<iframe id="subframe" onload="subframeLoaded()" width="20" height="20"></iframe>
</body>