toolkit/components/passwordmgr/test/test_bug_391514.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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: 391514
    11 <p id="display"></p>
    12 <div id="content" style="display: none">
    13   <!-- normal form. -->
    14   <form id="form1" action="formtest.js">
    15     <input  type="text"     name="uname">
    16     <input  type="password" name="pword">
    18     <button type="submit">Submit</button>
    19     <button type="reset"> Reset </button>
    20   </form>
    22   <!-- limited username -->
    23   <form id="form2" action="formtest.js">
    24     <input  type="text"     name="uname" maxlength="4">
    25     <input  type="password" name="pword">
    26   </form>
    28   <!-- limited password -->
    29   <form id="form3" action="formtest.js">
    30     <input  type="text"     name="uname">
    31     <input  type="password" name="pword" maxlength="4">
    32   </form>
    34   <!-- limited username and password -->
    35   <form id="form4" action="formtest.js">
    36     <input  type="text"     name="uname" maxlength="4">
    37     <input  type="password" name="pword" maxlength="4">
    38   </form>
    41   <!-- limited username -->
    42   <form id="form5" action="formtest.js">
    43     <input  type="text"     name="uname" maxlength="0">
    44     <input  type="password" name="pword">
    45   </form>
    47   <!-- limited password -->
    48   <form id="form6" action="formtest.js">
    49     <input  type="text"     name="uname">
    50     <input  type="password" name="pword" maxlength="0">
    51   </form>
    53   <!-- limited username and password -->
    54   <form id="form7" action="formtest.js">
    55     <input  type="text"     name="uname" maxlength="0">
    56     <input  type="password" name="pword" maxlength="0">
    57   </form>
    60   <!-- limited, but ok, username -->
    61   <form id="form8" action="formtest.js">
    62     <input  type="text"     name="uname" maxlength="999">
    63     <input  type="password" name="pword">
    64   </form>
    66   <!-- limited, but ok, password -->
    67   <form id="form9" action="formtest.js">
    68     <input  type="text"     name="uname">
    69     <input  type="password" name="pword" maxlength="999">
    70   </form>
    72   <!-- limited, but ok, username and password -->
    73   <form id="form10" action="formtest.js">
    74     <input  type="text"     name="uname" maxlength="999">
    75     <input  type="password" name="pword" maxlength="999">
    76   </form>
    79   <!-- limited, but ok, username -->
    80   <!-- (note that filled values are exactly 8 characters) -->
    81   <form id="form11" action="formtest.js">
    82     <input  type="text"     name="uname" maxlength="8">
    83     <input  type="password" name="pword">
    84   </form>
    86   <!-- limited, but ok, password -->
    87   <!-- (note that filled values are exactly 8 characters) -->
    88   <form id="form12" action="formtest.js">
    89     <input  type="text"     name="uname">
    90     <input  type="password" name="pword" maxlength="8">
    91   </form>
    93   <!-- limited, but ok, username and password -->
    94   <!-- (note that filled values are exactly 8 characters) -->
    95   <form id="form13" action="formtest.js">
    96     <input  type="text"     name="uname" maxlength="8">
    97     <input  type="password" name="pword" maxlength="8">
    98   </form>
   100 </div>
   101 <pre id="test">
   102 <script class="testbody" type="text/javascript">
   104 /* Test for Login Manager: 391514 (Login Manager gets confused with
   105  * password/PIN on usaa.com)
   106  */
   108 commonInit();
   110 function startTest() {
   111   var i;
   113   is($_(1, "uname").value, "testuser", "Checking for filled username 1");
   114   is($_(1, "pword").value, "testpass", "Checking for filled password 1");
   116   for (i = 2; i < 8; i++) {
   117     is($_(i, "uname").value, "", "Checking for unfilled username " + i);
   118     is($_(i, "pword").value, "", "Checking for unfilled password " + i);
   119   }
   121   for (i = 8; i < 14; i++) {
   122     is($_(i, "uname").value, "testuser", "Checking for filled username " + i);
   123     is($_(i, "pword").value, "testpass", "Checking for filled password " + i);
   124   }
   126   // Note that tests 11-13 are limited to exactly the expected value.
   127   // Assert this lest someone change the login we're testing with.
   128   is($_(11, "uname").value.length, 8, "asserting test assumption is valid.");
   130   SimpleTest.finish();
   131 }
   133 window.onload = startTest;
   135 SimpleTest.waitForExplicitFinish();
   137 </script>
   138 </pre>
   139 </body>
   140 </html>

mercurial