|
1 <!DOCTYPE html> |
|
2 <html> |
|
3 <head> |
|
4 <title>nsIAccessibleText getText related function tests for text and password inputs</title> |
|
5 <link rel="stylesheet" type="text/css" |
|
6 href="chrome://mochikit/content/tests/SimpleTest/test.css" /> |
|
7 |
|
8 <script type="application/javascript" |
|
9 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
|
10 <script type="application/javascript" |
|
11 src="../common.js"></script> |
|
12 <script type="application/javascript" |
|
13 src="../text.js"></script> |
|
14 |
|
15 <script type="application/javascript"> |
|
16 function doTest() |
|
17 { |
|
18 ////////////////////////////////////////////////////////////////////////// |
|
19 // regular text and password inputs |
|
20 ////////////////////////////////////////////////////////////////////////// |
|
21 |
|
22 //////////////////////////////////////////////////////////////////////// |
|
23 // characterCount and getText for regular text field |
|
24 |
|
25 var IDs = [ "username" ]; |
|
26 testCharacterCount(IDs, 4); |
|
27 testText(IDs, 0, 4, "test"); |
|
28 |
|
29 //////////////////////////////////////////////////////////////////////// |
|
30 // characterCount and getText for password field |
|
31 |
|
32 IDs = [ "password" ]; |
|
33 testCharacterCount(IDs, 4); |
|
34 testPasswordText(IDs, 0, 4, "test"); |
|
35 |
|
36 SimpleTest.finish(); |
|
37 } |
|
38 |
|
39 SimpleTest.waitForExplicitFinish(); |
|
40 addA11yLoadEvent(doTest); |
|
41 </script> |
|
42 </head> |
|
43 <body> |
|
44 |
|
45 <a target="_blank" |
|
46 title="mochitest for getText for password fields" |
|
47 href="https://bugzilla.mozilla.org/show_bug.cgi?id=415943">Mozilla Bug 415943</a> |
|
48 <p id="display"></p> |
|
49 <div id="content" style="display: none"></div> |
|
50 <pre id="test"> |
|
51 </pre> |
|
52 |
|
53 <form action="post.php" method="post"> |
|
54 <label for="username">User name:</label> |
|
55 <input id="username" value="test"><br /> |
|
56 <label for="password">Password:</label> |
|
57 <input type="password" id="password" value="test"/> |
|
58 </form> |
|
59 </body> |
|
60 </html> |