|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <head> |
|
4 <title>Test for Login Manager</title> |
|
5 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
6 <script type="text/javascript" src="pwmgr_common.js"></script> |
|
7 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
|
8 </head> |
|
9 <body> |
|
10 Login Manager test: 242956 |
|
11 <p id="display"></p> |
|
12 <div id="content" style="display: none"> |
|
13 <!-- pword is not a type=password input --> |
|
14 <form id="form1" action="formtest.js"> |
|
15 <input type="text" name="uname"> |
|
16 <input type="text" name="pword"> |
|
17 |
|
18 <button type="submit">Submit</button> |
|
19 <button type="reset"> Reset </button> |
|
20 </form> |
|
21 |
|
22 <!-- uname is not a type=text input --> |
|
23 <form id="form2" action="formtest.js"> |
|
24 <input type="password" name="uname"> |
|
25 <input type="password" name="pword"> |
|
26 |
|
27 <button type="submit">Submit</button> |
|
28 <button type="reset"> Reset </button> |
|
29 </form> |
|
30 |
|
31 <!-- two "pword" inputs, (text + password) --> |
|
32 <form id="form3" action="formtest.js"> |
|
33 <input type="text" name="uname"> |
|
34 <input type="text" name="pword"> |
|
35 <input type="password" name="qword"> |
|
36 |
|
37 <button type="submit">Submit</button> |
|
38 <button type="reset"> Reset </button> |
|
39 </form> |
|
40 |
|
41 <!-- same thing, different order --> |
|
42 <form id="form4" action="formtest.js"> |
|
43 <input type="text" name="uname"> |
|
44 <input type="password" name="pword"> |
|
45 <input type="text" name="qword"> |
|
46 |
|
47 <button type="submit">Submit</button> |
|
48 <button type="reset"> Reset </button> |
|
49 </form> |
|
50 |
|
51 <!-- uname is not a type=text input (try a checkbox just for variety) --> |
|
52 <form id="form5" action="formtest.js"> |
|
53 <input type="checkbox" name="uname" value=""> |
|
54 <input type="password" name="pword"> |
|
55 |
|
56 <button type="submit">Submit</button> |
|
57 <button type="reset"> Reset </button> |
|
58 </form> |
|
59 |
|
60 <!-- pword is not a type=password input (try a checkbox just for variety) --> |
|
61 <form id="form6" action="formtest.js"> |
|
62 <input type="text" name="uname"> |
|
63 <input type="checkbox" name="pword" value=""> |
|
64 |
|
65 <button type="submit">Submit</button> |
|
66 <button type="reset"> Reset </button> |
|
67 </form> |
|
68 |
|
69 <!-- pword is not a type=password input --> |
|
70 <form id="form7" action="formtest.js"> |
|
71 <input type="text" name="uname" value="testuser"> |
|
72 <input type="text" name="pword"> |
|
73 |
|
74 <button type="submit">Submit</button> |
|
75 <button type="reset"> Reset </button> |
|
76 </form> |
|
77 |
|
78 |
|
79 </div> |
|
80 <pre id="test"> |
|
81 <script class="testbody" type="text/javascript"> |
|
82 |
|
83 /** Test for Login Manager: 242956 (Stored password is inserted into a |
|
84 readable text input on a second page) **/ |
|
85 commonInit(); |
|
86 |
|
87 // Make sure that pwmgr only puts passwords into type=password <input>s. |
|
88 // Might as well test the converse, too (username in password field). |
|
89 |
|
90 function startTest() { |
|
91 var form, input; |
|
92 |
|
93 is($_(1, "uname").value, "", "Checking for unfilled username 1"); |
|
94 is($_(1, "pword").value, "", "Checking for unfilled password 1"); |
|
95 |
|
96 is($_(2, "uname").value, "testpass", "Checking for password not username 2"); |
|
97 is($_(2, "pword").value, "", "Checking for unfilled password 2"); |
|
98 |
|
99 is($_(3, "uname").value, "", "Checking for unfilled username 3"); |
|
100 is($_(3, "pword").value, "testuser", "Checking for unfilled password 3"); |
|
101 is($_(3, "qword").value, "testpass", "Checking for unfilled qassword 3"); |
|
102 |
|
103 is($_(4, "uname").value, "testuser", "Checking for password not username 4"); |
|
104 is($_(4, "pword").value, "testpass", "Checking for unfilled password 4"); |
|
105 is($_(4, "qword").value, "", "Checking for unfilled qassword 4"); |
|
106 |
|
107 is($_(5, "uname").value, "", "Checking for unfilled username 5"); |
|
108 is($_(5, "pword").value, "testpass", "Checking for filled password 5"); |
|
109 |
|
110 is($_(6, "uname").value, "", "Checking for unfilled username 6"); |
|
111 is($_(6, "pword").value, "", "Checking for unfilled password 6"); |
|
112 |
|
113 is($_(7, "uname").value, "testuser", "Checking for unmodified username 7"); |
|
114 is($_(7, "pword").value, "", "Checking for unfilled password 7"); |
|
115 |
|
116 |
|
117 |
|
118 SimpleTest.finish(); |
|
119 } |
|
120 |
|
121 window.onload = startTest; |
|
122 |
|
123 SimpleTest.waitForExplicitFinish(); |
|
124 |
|
125 </script> |
|
126 </pre> |
|
127 </body> |
|
128 </html> |