DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (5b81998bb7ab)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
<!DOCTYPE HTML>
<html>
<head>
  <title>Test for Login Manager</title>
  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>  
  <script type="text/javascript" src="pwmgr_common.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
Test limiting number of forms filled.

<p id="display"></p>
<div id="content" style="display: none"></div>


<script>
var FORMS_TO_CREATE = 41;

function createForm(id) {
    var template1 = "<form id='form"
    var template2 = "'><input name='u'><input type='password' name='p'></form>\n";
    return id + template1 + id + template2;
}

var formsHtml = "";
for (var i = 1; i <= FORMS_TO_CREATE; i++) {
    formsHtml += createForm(i);
}

var theDiv = document.getElementById("content");
theDiv.innerHTML = formsHtml;
</script>


<pre id="test">
<script class="testbody" type="text/javascript">
commonInit();
/** Test for Login Manager: form fill, multiple forms. **/

function startTest() {
  for (var i = 1; i <= FORMS_TO_CREATE; i++) {
    if (i != 21) {
      is($_(i, "u").value, "testuser", "Checking for filled username in form " + i);
      is($_(i, "p").value, "testpass", "Checking for filled password in form " + i);
    } else {
      is($_(i, "u").value, "", "Checking for unfilled username in form " + i);
      is($_(i, "p").value, "", "Checking for unfilled password in form " + i);
    }
  }

  SimpleTest.finish();
}

window.onload = startTest;

SimpleTest.waitForExplicitFinish();
</script>
</pre>
</body>
</html>