blob: cf1a135065afabda598fb9b2b42abd6b4ac4aa90 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test not counting third-party images as third-party script loads</title>
<script src="/js-test-resources/js-test.js"></script>
<script src="resources/util.js"></script>
</head>
<body onload="runTest()">
<script>
const thirdPartyOrigin = "http://localhost:8000";
const thirdPartyBaseUrl = thirdPartyOrigin + "/resources";
function finishTest() {
testRunner.dumpResourceLoadStatistics();
setEnableFeature(false, function() {
testRunner.notifyDone();
});
}
function runTest() {
switch (document.location.hash) {
case "":
if (window.testRunner && window.internals) {
testRunner.waitUntilDone();
setEnableFeature(true, function() {
testRunner.setUseITPDatabase(true);
testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true);
testRunner.installStatisticsDidScanDataRecordsCallback(finishTest);
document.location.hash = "step1";
runTest();
});
}
break;
case "#step1":
document.location.hash = "step2";
let imgElement = document.createElement("img");
imgElement.onload = runTest;
imgElement.src = thirdPartyBaseUrl + "/square20.jpg?dummyParam=" + Math.random();
document.body.appendChild(imgElement);
break;
case "#step2":
testRunner.statisticsNotifyObserver();
break;
}
}
</script>
</body>
</html>