blob: e374236656da6028c16a0f4d9e334a05b18062cb [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="/js-test-resources/js-test.js"></script>
<script>
window.jsTestIsAsync = true;
testRunner.waitUntilDone();
var givenLoadEventTargets = [];
function handleLoad(event)
{
givenLoadEventTargets.push(event.target.id);
if (givenLoadEventTargets.length == 4) {
shouldBe("['bye', 'hello1', 'hello2', 'hello3']", "givenLoadEventTargets.sort()");
finishJSTest();
}
}
</script>
<link id="hello1" rel="import" href="resources/hello.html" onload="handleLoad(event)">
<link id="hello2" rel="import" href="resources/hello.html" onload="handleLoad(event)">
</head>
<body>
<script>
var linkToInsert = document.createElement("link");
linkToInsert.id = "bye";
linkToInsert.setAttribute("rel", "import");
linkToInsert.setAttribute("href", "resources/bye.html");
linkToInsert.onload = handleLoad;
document.head.appendChild(linkToInsert);
</script>
<link id="hello3" rel="import" href="resources/hello.html" onload="handleLoad(event)">
</body>
</html>