accessible/tests/mochitest/text/test_passwords.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/accessible/tests/mochitest/text/test_passwords.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,60 @@
     1.4 +<!DOCTYPE html>
     1.5 +<html>
     1.6 +<head>
     1.7 +  <title>nsIAccessibleText getText related function tests for text and password inputs</title>
     1.8 +  <link rel="stylesheet" type="text/css"
     1.9 +        href="chrome://mochikit/content/tests/SimpleTest/test.css" />
    1.10 +
    1.11 +  <script type="application/javascript"
    1.12 +          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    1.13 +  <script type="application/javascript"
    1.14 +          src="../common.js"></script>
    1.15 +  <script type="application/javascript"
    1.16 +          src="../text.js"></script>
    1.17 +
    1.18 +  <script type="application/javascript">
    1.19 +    function doTest()
    1.20 +    {
    1.21 +      //////////////////////////////////////////////////////////////////////////
    1.22 +      // regular text and password inputs
    1.23 +      //////////////////////////////////////////////////////////////////////////
    1.24 +
    1.25 +      ////////////////////////////////////////////////////////////////////////
    1.26 +      // characterCount and getText for regular text field
    1.27 +
    1.28 +      var IDs = [ "username" ];
    1.29 +      testCharacterCount(IDs, 4);
    1.30 +      testText(IDs, 0, 4, "test");
    1.31 +
    1.32 +      ////////////////////////////////////////////////////////////////////////
    1.33 +      // characterCount and getText for password field
    1.34 +
    1.35 +      IDs = [ "password" ];
    1.36 +      testCharacterCount(IDs, 4);
    1.37 +      testPasswordText(IDs, 0, 4, "test");
    1.38 +
    1.39 +      SimpleTest.finish();
    1.40 +    }
    1.41 +
    1.42 +    SimpleTest.waitForExplicitFinish();
    1.43 +    addA11yLoadEvent(doTest);
    1.44 +  </script>
    1.45 +</head>
    1.46 +<body>
    1.47 +
    1.48 +  <a target="_blank"
    1.49 +     title="mochitest for getText for password fields"
    1.50 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=415943">Mozilla Bug 415943</a>
    1.51 +  <p id="display"></p>
    1.52 +  <div id="content" style="display: none"></div>
    1.53 +  <pre id="test">
    1.54 +  </pre>
    1.55 +
    1.56 +  <form action="post.php" method="post">
    1.57 +    <label for="username">User name:</label>
    1.58 +    <input id="username" value="test"><br />
    1.59 +    <label for="password">Password:</label>
    1.60 +    <input type="password" id="password" value="test"/>
    1.61 +  </form>
    1.62 +</body>
    1.63 +</html>

mercurial