Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE HTML>
<html>
<head>
<title>Test for CHIPS cookie in reporting response</title>
</head>
<body>
<script type="application/javascript">
function ok(a, msg) {
parent.postMessage({type: "test", check: !!a, msg }, "*");
}
function finish() {
parent.postMessage({type: "finish" }, "*");
}
function checkReport() {
return new Promise(resolve => {
let id = setInterval(_ => {
fetch("delivering.sjs?task=check&min=1")
.then(r => r.text())
.then(text => {
if (text) {
resolve(JSON.parse(text));
clearInterval(id);
}
});
}, 1000);
});
}
// Trigger a deprecation report.
new TestingDeprecatedInterface();
checkReport()
.then(reports => {
ok(reports.length >= 1, "We received at least one report");
ok(!!reports[0].body, "The report has a body");
finish();
});
</script>
</body>
</html>