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

Unified Diff: LayoutTests/fast/forms/select-max-length.html

Issue 1291263003: Index setter of HTMLSelectElement and HTMLOptionsCollection should do nothing if the requested size… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update warning messages Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/forms/select-max-length.html
diff --git a/LayoutTests/fast/forms/select-max-length.html b/LayoutTests/fast/forms/select-max-length.html
index 443cc5100630c0dfba9769810d2067bc1661e778..f18c83f8be9aaa4cc7b122c7bae6b24d15b091f2 100644
--- a/LayoutTests/fast/forms/select-max-length.html
+++ b/LayoutTests/fast/forms/select-max-length.html
@@ -1,28 +1,24 @@
<p>This test that setting HTMLSelectElement.length is capped to 10,000, but that you can add additional Option elements by calling add.</p>
-<pre id="console"></pre>
+<div id="console"></div>
<select id="theSelect"></select>
-
+<script src="../../resources/js-test.js"></script>
<script>
- if (window.testRunner)
- testRunner.dumpAsText();
-
- function log(msg)
- {
- document.getElementById("console").appendChild(document.createTextNode(msg + "\n"));
- }
-
var sel = document.getElementById('theSelect');
- log("Select length is " + sel.length);
+ shouldBe('sel.length', '0');
- log("Trying: - sel.length = 20000;");
+ debug('Trying: - sel.length = 20000;');
sel.length = 20000;
- log("Select length is " + sel.length);
+ shouldBe('sel.length', '0');
- log("Trying: - sel.add(new Option, 0);");
+ debug('Trying: - sel.add(new Option, 0);');
sel.add(new Option, 0);
- log("Select length is " + sel.length);
+ shouldBe('sel.length', '1');
- log("Trying: - sel.length = 0;");
+ debug('Trying: - sel.length = 0;');
sel.length = 0;
- log("Select length is " + sel.length);
+ shouldBe('sel.length', '0');
+
+ debug('Index setter:');
+ shouldBe('sel[20000] = new Option(); sel.length', '0');
+ shouldBe('sel.options[20000] = new Option(); sel.length', '0');
</script>

Powered by Google App Engine
This is Rietveld 408576698