blob: 8bf40abf67988aace32fac19a8b8e6d81c3a9d10 [file] [log] [blame]
<html>
<head>
<script>
function test()
{
if (window.layoutTestController)
layoutTestController.waitUntilDone();
// 1) leave field 1 alone. It should show the placeholder text.
// 2) focus field 2 and type. It should show bullets for the password.
var password = document.getElementById("pass2");
password.focus();
document.execCommand("InsertText", false, "test");
// 3) focus field 3 and type. Clear the value and blur the field. It should show the placeholder text.
password = document.getElementById("pass3");
password.focus();
document.execCommand("InsertText", false, "test");
password.value = "";
password.blur();
if (window.layoutTestController)
layoutTestController.notifyDone();
}
function log(msg)
{
document.getElementById('console').appendChild(document.createTextNode(msg + "\n"));
}
</script>
</head>
<body onload="test()">
This tests that the text security mode switches correctly when the placeholder appears and disappears.<br>
Leave field 1 alone. It should show the placeholder text: <input type="password" id="pass1" placeholder="placeholder"><br>
Focus field 2 and type. It should show bullets for the password.: <input type="password" id="pass2" placeholder="placeholder"><br>
Focus field 3 and type. Clear the value and blur the field. It should show the placeholder text: <input type="password" id="pass3" placeholder="placeholder"><br>
</body>
</html>