summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/editing/deleting/password-delete-performance.html
blob: ce2520fdb24de14ea9278eb1a7751b941d58c8cb (plain)
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
<!DOCTYPE html>
<html>
    <body>
        <p id="description">This test ensures that deleting characters from a password field that follows large content blocks is not slow.
        To run the test manually, delete the character from the password field. The user agent should not freeze.</p>

        <div id="content" style="height:0px; overflow:hidden;"> </div>
        <input id="field" type="password" value="A">

        <script src="../editing.js"></script>
        <script>
            if (window.testRunner)
                testRunner.dumpAsText();

            var newContent = '<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>';
            for (var i = 0; i < 13; i++) {
                newContent += newContent;
            }

            var contentDiv = document.getElementById('content');
            contentDiv.innerHTML = newContent;

            document.getElementById("field").focus();
            document.execCommand("Delete");

            // We clear the content div to avoid having its content appear in the test harness output.
            if (window.testRunner)
                contentDiv.innerHTML = "";
        </script>
    </body>
</html>