Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/forms/text/input-maxlength.html

Issue 1867243002: Remove fast/forms/text/input-maxlength.html. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/forms/text/input-maxlength-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <p>This page tests that the <tt>maxlength</tt> attribute of the <tt>&lt;input&gt ;</tt> element works correctly. <a href="http://bugs.webkit.org/show_bug.cgi?id= 14388">http://bugs.webkit.org/show_bug.cgi?id=14388</a></p>
8 <div id="console"></div>
9
10 <input id="input">
11
12 <script>
13 var implicitMaxLength = 524288;
14 var testString = "";
15 var input = document.getElementById("input");
16
17 function attempt(length, expected)
18 {
19 debug("Attempting to insert " + length + " characters with maxLength = " + input.getAttribute("maxlength") + ".");
20
21 if (testString.length > length)
22 testString = "";
23
24 for (var i = testString.length; i < length; ++i)
25 testString += i % 10;
26
27 input.value = testString;
28 if (input.value.length == expected)
29 testPassed("");
30 else
31 testFailed("Expected " + domExpected + " characters to be inserted, but " + input.value.length + " characters were actually inserted.");
32 }
33
34 var stringLengthsToTest = [0, 5, 100, 101, 200, 524287, 524288, 524289, 5300 00];
35 var maxLengthsToTest = ["-1", "100", "524288", "600000"];
36
37 for (var i = 0; i < stringLengthsToTest.length; ++i) {
38 var stringLength = stringLengthsToTest[i];
39 for (var j = 0; j < maxLengthsToTest.length; ++j) {
40 var maxLength = maxLengthsToTest[j];
41 input.setAttribute("maxlength", maxLength);
42 var expected = Math.min(stringLength, implicitMaxLength);
43 attempt(stringLength, expected);
44 }
45 }
46
47 debug('Some tests for .maxLength property.');
48 input = document.createElement("input");
49 input.maxLength = 100;
50 shouldBe("input.getAttribute('maxlength')", "'100'");
51 </script>
52 </body>
53 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/forms/text/input-maxlength-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698