chromium/third_party/blink/web_tests/fast/dom/shadow/tooltips-in-shadow.html

<!DOCTYPE html>
<html>
<body onload="test()">
<script src="../../../resources/js-test.js"></script>
<script src="resources/shadow-dom.js"></script>
<div id="container">
</div>

<script>
window.jsTestIsAsync = true;

function setup()
{
   var D = createDOM;
   var S = createShadowRoot;
   var cases = [];

   label1 = 'Case1: Non-Nested';
   container.appendChild(D('div', {'id': 'host1'}, S(D('a', {'id': 'target1', 'title': label1}, document.createTextNode("Hello1")))));
   cases.push({ target: getNodeInComposedTree('host1/target1'), expected: label1 });

   label2 = 'Case 2: Nested';
   container.appendChild(D('div', {'id': 'host2'}, S(D('div', {'id': 'host2b'}, S(D('a', {'id': 'target2', 'title': label2}, document.createTextNode("Hello2")))))));
   cases.push({ target: getNodeInComposedTree('host2/host2b/target2'), expected: label2 });

   return cases;
}

function moveTo(target)
{
    if (window.eventSender) {
        eventSender.dragMode = false;
        eventSender.mouseMoveTo(target.offsetLeft, target.offsetTop + target.offsetHeight / 2);
    }
}

function test()
{
    var harnesses = setup();

    for (var i = 0; i < harnesses.length; i++) {
        harness = harnesses[i];
        moveTo(harness.target);
        if (window.testRunner)
            debug("Test for " + harness.expected);
            shouldBe("harness.expected", "testRunner.tooltipText");
    }

    container.style.display = "none";
    finishJSTest();

}
</script>
</body>
</html>