blob: 6ef70a37becf5c9b877938977bf87feaab0aec2a [file] [log] [blame]
<head>
<script>
if (window.testRunner && window.internals) {
testRunner.dumpAsText();
testRunner.dumpChildFramesAsText();
internals.settings.setHyperlinkAuditingEnabled(true);
testRunner.waitUntilDone();
}
function loadLinkWithPing() {
var iframe = document.getElementById("link_frame");
var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
iframeDoc.write('' +
'<img src="resources/delete-ping.php?test=contentextensions-block-cookies-in-ping" ' +
'onerror="parent.clickOnLinkWithPing();">' +
'<a id="a" ' +
'href="resources/check-ping.html" ' + // check-ping.html calls showPingResult()
'ping="resources/save-ping.php?test=contentextensions-block-cookies-in-ping"> ' +
'Link with ping' +
'</a>'
);
}
function clickOnLinkWithPing() {
var iframe = document.getElementById("link_frame");
var iframeDoc = iframe.contentDocument;
if (window.eventSender) {
var a = iframeDoc.getElementById("a");
var x = iframe.offsetLeft + a.offsetLeft + 2;
var y = iframe.offsetTop + a.offsetTop + 2;
eventSender.mouseMoveTo(x, y);
eventSender.mouseDown();
eventSender.mouseUp();
}
}
function showPingResult() {
var iframe = document.getElementById("result_frame");
iframe.onload = function() {
if (window.testRunner) { testRunner.notifyDone() }
}
iframe.src = "resources/get-ping-data.php?test=contentextensions-block-cookies-in-ping";
}
</script>
</head>
<body>
This test sets a cookie, then follows a link with a ping attribute where the ping URL matches a 'block-cookie' rule.
<img src="http://localhost:8000/cookies/resources/cookie-utility.php?queryfunction=setFooCookie"
onerror="loadLinkWithPing();">
<iframe id="link_frame" name="link_frame"><!-- Will contain link with ping --></iframe>
<iframe id="result_frame" name="result_frame"><!-- Will contain ping data received by server --></iframe>
</body>