[Mac] Add tests for secure event input
[WebKit-https.git] / LayoutTests / editing / secure-input / password-input-focusing.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <script src="../../fast/js/resources/js-test-pre.js"></script>
6 </head>
7 <body>
8 <input type=password>
9 <input type=text>
10 <script>
11
12 description("Verify that basic focusing/unfocusing updates secure input state.");
13
14 var passwordInput = document.getElementsByTagName("input")[0];
15 var textInput = document.getElementsByTagName("input")[1];
16
17 debug("Initial state, no selection:");
18 shouldBe("testRunner.secureEventInputIsEnabled", "false");
19
20 debug("\nA password input is focused:");
21 passwordInput.focus();
22 shouldBe("testRunner.secureEventInputIsEnabled", "true");
23
24 debug("\nA regular text input is focused:");
25 textInput.focus();
26 shouldBe("testRunner.secureEventInputIsEnabled", "false");
27
28 debug("\nA password input is focused again:");
29 passwordInput.focus();
30 shouldBe("testRunner.secureEventInputIsEnabled", "true");
31
32 </script>
33 <script src="../../fast/js/resources/js-test-post.js"></script>
34 </body>
35 </html>