chromium/third_party/blink/web_tests/fast/events/click-checkbox-refocus-window.html

<!DOCTYPE html>
<html>
<head>
</head>
<body>
<p>This test ensures that the focus ring is not shown on the checkbox after blurring and focusing the window.</p>
<input type="checkbox" id="checkbox">
<pre id="console">
</pre>

<script>
var checkbox = document.getElementById('checkbox');
window.onfocus = function() {
    log('window was focused');
};
window.onblur = function() {
    log('window was blurred');
};
checkbox.onfocus = function() {
    log('checkbox was focused');
};
checkbox.onblur = function() {
    log('checkbox was blurred');
};
window.onload = function() {
    if (window.eventSender) {
        eventSender.mouseMoveTo(checkbox.offsetLeft + 2, checkbox.offsetTop + 2);
        eventSender.mouseDown();
        eventSender.mouseUp();
        internals.setFocused(false);
        internals.setFocused(true);

        // Get rid of the #checkbox:hover style.
        eventSender.mouseMoveTo(0, 0);
    }
};

function log(message) {
    var console = document.getElementById("console");
    console.textContent += message + '\n';
}
</script>
</body>
</html>