<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="../../../resources/ui-helper.js"></script>
<script src="../../../resources/js-test.js"></script>
<style>
body, html {
    width: 100%;
    height: 100%;
    margin: 0;
}

#editor {
    width: 250px;
    font-size: 20px;
    padding: 10px;
    display: block;
    border: 1px solid tomato;
    caret-color: auto;
}
</style>
<script>
jsTestIsAsync = true;

addEventListener("load", async () => {
    description("This test verifies that an 'auto' caret color uses the system default caret color on iOS.");

    if (!window.testRunner)
        return;

    let editor = document.getElementById("editor");
    await UIHelper.activateElementAndWaitForInputSession(editor);
    await UIHelper.ensurePresentationUpdate();
    caretColor = await UIHelper.selectionCaretBackgroundColor();

    shouldBeEqualToString("caretColor", "rgb(66, 107, 242)");

    editor.blur();
    await UIHelper.waitForKeyboardToHide();
    finishJSTest();
});
</script>
</head>
<body>
<div contenteditable id="editor"></div>
</body>
</html>
