<head>
<script>
if (window.testRunner && window.internals) {
    testRunner.dumpAsText();
    testRunner.dumpChildFramesAsText();
    internals.settings.setHyperlinkAuditingEnabled(true);
    testRunner.waitUntilDone();
}

function clickOnLinkWithPing() {
    if (window.eventSender) {
        var a = document.getElementById("a");
        var x = a.offsetLeft + 2;
        var y = 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.py?test=contentextensions-hide-on-ping";
}
</script>
</head>

<body>
This test follows a link with a ping attribute where the ping URL matches a 'css-display-none' rule.
<div class="foo">This text should be hidden once the ping is sent.</div>
<div class="bar">This text should remain visible.</div>
<div>
<img src="resources/delete-ping.py?test=contentextensions-hide-on-ping" onerror="clickOnLinkWithPing();">
<a id="a" href="#a" ping="resources/save-ping.py?test=contentextensions-hide-on-ping" onclick="showPingResult();">Link with ping</a>
</div>
<iframe id="result_frame" name="result_frame"><!-- Will contain ping data received by server --></iframe>
</body>

