blob: 5fda812019a9e73ff9558915e0f88926a8d9049a [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="/js-test-resources/js-test.js"></script>
<script src="resources/util.js"></script>
</head>
<body>
<script>
description("Test for enabling debug mode and that it allows setting a custom domain as a prevalent resource.");
jsTestIsAsync = true;
const thirdPartyOrigin = "http://localhost:8000";
if (window.testRunner && window.internals) {
testRunner.setUseITPDatabase(true);
setEnableFeature(true, function() {
if (testRunner.isStatisticsPrevalentResource(thirdPartyOrigin))
testFailed(thirdPartyOrigin + " already set as prevalent resource.");
testRunner.setStatisticsPrevalentResourceForDebugMode(thirdPartyOrigin, function() {
testRunner.setStatisticsDebugMode(true, function() {
if (!testRunner.isStatisticsPrevalentResource(thirdPartyOrigin))
testFailed(thirdPartyOrigin + " didn't get set as prevalent resource.");
else
testPassed(thirdPartyOrigin + " got set as a custom prevalent resource in debug mode.");
testRunner.setStatisticsDebugMode(false, function() {
setEnableFeature(false, finishJSTest);
});
});
});
});
}
</script>
</body>
</html>