Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <head> |
michael@0 | 4 | <title>Test for Login Manager</title> |
michael@0 | 5 | <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 6 | <script type="text/javascript" src="pwmgr_common.js"></script> |
michael@0 | 7 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
michael@0 | 8 | </head> |
michael@0 | 9 | <body> |
michael@0 | 10 | Login Manager test: 391514 |
michael@0 | 11 | <p id="display"></p> |
michael@0 | 12 | <div id="content" style="display: none"> |
michael@0 | 13 | <!-- normal form. --> |
michael@0 | 14 | <form id="form1" action="formtest.js"> |
michael@0 | 15 | <input type="text" name="uname"> |
michael@0 | 16 | <input type="password" name="pword"> |
michael@0 | 17 | |
michael@0 | 18 | <button type="submit">Submit</button> |
michael@0 | 19 | <button type="reset"> Reset </button> |
michael@0 | 20 | </form> |
michael@0 | 21 | |
michael@0 | 22 | <!-- limited username --> |
michael@0 | 23 | <form id="form2" action="formtest.js"> |
michael@0 | 24 | <input type="text" name="uname" maxlength="4"> |
michael@0 | 25 | <input type="password" name="pword"> |
michael@0 | 26 | </form> |
michael@0 | 27 | |
michael@0 | 28 | <!-- limited password --> |
michael@0 | 29 | <form id="form3" action="formtest.js"> |
michael@0 | 30 | <input type="text" name="uname"> |
michael@0 | 31 | <input type="password" name="pword" maxlength="4"> |
michael@0 | 32 | </form> |
michael@0 | 33 | |
michael@0 | 34 | <!-- limited username and password --> |
michael@0 | 35 | <form id="form4" action="formtest.js"> |
michael@0 | 36 | <input type="text" name="uname" maxlength="4"> |
michael@0 | 37 | <input type="password" name="pword" maxlength="4"> |
michael@0 | 38 | </form> |
michael@0 | 39 | |
michael@0 | 40 | |
michael@0 | 41 | <!-- limited username --> |
michael@0 | 42 | <form id="form5" action="formtest.js"> |
michael@0 | 43 | <input type="text" name="uname" maxlength="0"> |
michael@0 | 44 | <input type="password" name="pword"> |
michael@0 | 45 | </form> |
michael@0 | 46 | |
michael@0 | 47 | <!-- limited password --> |
michael@0 | 48 | <form id="form6" action="formtest.js"> |
michael@0 | 49 | <input type="text" name="uname"> |
michael@0 | 50 | <input type="password" name="pword" maxlength="0"> |
michael@0 | 51 | </form> |
michael@0 | 52 | |
michael@0 | 53 | <!-- limited username and password --> |
michael@0 | 54 | <form id="form7" action="formtest.js"> |
michael@0 | 55 | <input type="text" name="uname" maxlength="0"> |
michael@0 | 56 | <input type="password" name="pword" maxlength="0"> |
michael@0 | 57 | </form> |
michael@0 | 58 | |
michael@0 | 59 | |
michael@0 | 60 | <!-- limited, but ok, username --> |
michael@0 | 61 | <form id="form8" action="formtest.js"> |
michael@0 | 62 | <input type="text" name="uname" maxlength="999"> |
michael@0 | 63 | <input type="password" name="pword"> |
michael@0 | 64 | </form> |
michael@0 | 65 | |
michael@0 | 66 | <!-- limited, but ok, password --> |
michael@0 | 67 | <form id="form9" action="formtest.js"> |
michael@0 | 68 | <input type="text" name="uname"> |
michael@0 | 69 | <input type="password" name="pword" maxlength="999"> |
michael@0 | 70 | </form> |
michael@0 | 71 | |
michael@0 | 72 | <!-- limited, but ok, username and password --> |
michael@0 | 73 | <form id="form10" action="formtest.js"> |
michael@0 | 74 | <input type="text" name="uname" maxlength="999"> |
michael@0 | 75 | <input type="password" name="pword" maxlength="999"> |
michael@0 | 76 | </form> |
michael@0 | 77 | |
michael@0 | 78 | |
michael@0 | 79 | <!-- limited, but ok, username --> |
michael@0 | 80 | <!-- (note that filled values are exactly 8 characters) --> |
michael@0 | 81 | <form id="form11" action="formtest.js"> |
michael@0 | 82 | <input type="text" name="uname" maxlength="8"> |
michael@0 | 83 | <input type="password" name="pword"> |
michael@0 | 84 | </form> |
michael@0 | 85 | |
michael@0 | 86 | <!-- limited, but ok, password --> |
michael@0 | 87 | <!-- (note that filled values are exactly 8 characters) --> |
michael@0 | 88 | <form id="form12" action="formtest.js"> |
michael@0 | 89 | <input type="text" name="uname"> |
michael@0 | 90 | <input type="password" name="pword" maxlength="8"> |
michael@0 | 91 | </form> |
michael@0 | 92 | |
michael@0 | 93 | <!-- limited, but ok, username and password --> |
michael@0 | 94 | <!-- (note that filled values are exactly 8 characters) --> |
michael@0 | 95 | <form id="form13" action="formtest.js"> |
michael@0 | 96 | <input type="text" name="uname" maxlength="8"> |
michael@0 | 97 | <input type="password" name="pword" maxlength="8"> |
michael@0 | 98 | </form> |
michael@0 | 99 | |
michael@0 | 100 | </div> |
michael@0 | 101 | <pre id="test"> |
michael@0 | 102 | <script class="testbody" type="text/javascript"> |
michael@0 | 103 | |
michael@0 | 104 | /* Test for Login Manager: 391514 (Login Manager gets confused with |
michael@0 | 105 | * password/PIN on usaa.com) |
michael@0 | 106 | */ |
michael@0 | 107 | |
michael@0 | 108 | commonInit(); |
michael@0 | 109 | |
michael@0 | 110 | function startTest() { |
michael@0 | 111 | var i; |
michael@0 | 112 | |
michael@0 | 113 | is($_(1, "uname").value, "testuser", "Checking for filled username 1"); |
michael@0 | 114 | is($_(1, "pword").value, "testpass", "Checking for filled password 1"); |
michael@0 | 115 | |
michael@0 | 116 | for (i = 2; i < 8; i++) { |
michael@0 | 117 | is($_(i, "uname").value, "", "Checking for unfilled username " + i); |
michael@0 | 118 | is($_(i, "pword").value, "", "Checking for unfilled password " + i); |
michael@0 | 119 | } |
michael@0 | 120 | |
michael@0 | 121 | for (i = 8; i < 14; i++) { |
michael@0 | 122 | is($_(i, "uname").value, "testuser", "Checking for filled username " + i); |
michael@0 | 123 | is($_(i, "pword").value, "testpass", "Checking for filled password " + i); |
michael@0 | 124 | } |
michael@0 | 125 | |
michael@0 | 126 | // Note that tests 11-13 are limited to exactly the expected value. |
michael@0 | 127 | // Assert this lest someone change the login we're testing with. |
michael@0 | 128 | is($_(11, "uname").value.length, 8, "asserting test assumption is valid."); |
michael@0 | 129 | |
michael@0 | 130 | SimpleTest.finish(); |
michael@0 | 131 | } |
michael@0 | 132 | |
michael@0 | 133 | window.onload = startTest; |
michael@0 | 134 | |
michael@0 | 135 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 136 | |
michael@0 | 137 | </script> |
michael@0 | 138 | </pre> |
michael@0 | 139 | </body> |
michael@0 | 140 | </html> |