<!DOCTYPE html> <!-- webkit-test-runner [ appHighlightsEnabled=true ] -->
<html>
<head>
<script src="../../../../resources/js-test.js"></script>
<style>
body, html {
    margin: 0;
}

p {
    font-size: 32px;
    display: inline-block;
}
</style>
</head>
<body>
<img src="../../resources/green-400x400.png"></img>
<p>Hello world this is a test.</p>
</body>
<script>
var foundTitle1;
var foundTitle2;

function checkForAppHighlightContextMenuItems() {
    foundTitle1 = false;
    foundTitle2 = false;

    let [title1, title2] = internals.appHighlightContextMenuItemTitles;
    for (let item of eventSender.contextClick()) {
        if (item.title === title1)
            foundTitle1 = true;

        if (item.title === title2)
            foundTitle2 = true;
    }
}

addEventListener("load", () => {
    let text = document.querySelector("p");
    let textRect = text.getBoundingClientRect();
    let image = document.querySelector("img");

    internals.installImageOverlay(image, [
        {
            topLeft : new DOMPointReadOnly(0, 0),
            topRight : new DOMPointReadOnly(1, 0),
            bottomRight : new DOMPointReadOnly(1, 1),
            bottomLeft : new DOMPointReadOnly(0, 1),
            children: [
                {
                    text : "foobar",
                    topLeft : new DOMPointReadOnly(0, 0),
                    topRight : new DOMPointReadOnly(1, 0),
                    bottomRight : new DOMPointReadOnly(1, 1),
                    bottomLeft : new DOMPointReadOnly(0, 1),
                }
            ]
        }
    ]);

    getSelection().selectAllChildren(text);
    eventSender.mouseMoveTo(textRect.left + textRect.width / 2, textRect.top + textRect.height / 2);
    checkForAppHighlightContextMenuItems();
    shouldBeTrue("foundTitle1");
    shouldBeTrue("foundTitle2");

    getSelection().selectAllChildren(internals.shadowRoot(image).querySelector("div#image-overlay"));
    testPassed("Selected image overlay")
    eventSender.mouseMoveTo(200, 200);
    checkForAppHighlightContextMenuItems();
    shouldBeFalse("foundTitle1");
    shouldBeFalse("foundTitle2");

    text.remove();
});
</script>
</html>