Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!DOCTYPE html>
<meta charset="utf-8">
<title>Resource Timing - initiatorUrl for a resource fetched in an event handler that overwrote a previous one</title>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/get-host-info.sub.js"></script>
<script src="../../resources/test-initiator.js"></script>
<script src="../../resources/loading-resource-lib.js"></script>
<div id="log"></div>
<script>
const img1 = document.createElement("img");
document.body.appendChild(img1);
const img2 = document.createElement("img");
document.body.appendChild(img2);
const frame = document.createElement("iframe");
frame.onload = () => {
load_image(label, img1, "blue.png");
};
frame.onload = () => {
load_image(label, img2, "red.png");
};
frame.src = "../resources/green.html";
document.body.appendChild(frame);
const label = "initiator_url_eventhandler";
const resource = "/images/red.png?" + label;
const expectedInitiatorUrl = getUrl(
"/resource-timing/tentative/initiator-url/event-handler-overwritten.html");
initiator_url_test(resource, expectedInitiatorUrl, resource +
" initiatorUrl from event handlers", resource + " timeout");
</script>