summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/textfield-to-password-on-focus.html
blob: 16a4c6fcb41e4efec7076613ee7582cb4b783e8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>    
<link rel="stylesheet" href="../js/resources/js-test-style.css">
<script src="../js/resources/js-test-pre.js"></script>
<script>
if (window.layoutTestController) {
    window.layoutTestController.waitUntilDone();
    window.layoutTestController.dumpAsText();
}

function changeToPasswordField(textField)
{
    textField.setAttribute("type", "password");
}

function test()
{
    if (window.layoutTestController) {
        var field = document.getElementById("field").focus();

        eventSender.keyDown("p");
        eventSender.keyDown("a");
        eventSender.keyDown("s");
        eventSender.keyDown("s");

        shouldBe('field.value', "'pass'");
        isSuccessfullyParsed();

        window.layoutTestController.notifyDone();
    }
}
</script>
</head>
<body onload="test()">
<ol><li>Hit Tab key to focus input field.</li><li>Type some text.</li></ol>
<input type="text" id="field" onfocus="changeToPasswordField(this)">
<hr>
<p id="description"></p>
<div id="console"></div>
<script>
description("Test for <a href=\"https://bugs.webkit.org/show_bug.cgi?id=18900\">Bug 18900: Password field has focus but can't type text (i.rememberthemilk.com)</a>");
successfullyParsed = true;
</script>
<script src="../js/resources/js-test-post-function.js"></script>
</body>
</html>