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

Unified Diff: third_party/WebKit/LayoutTests/fast/forms/add-and-remove-option.html

Issue 1509853008: Move select/option/optgroup-related tests in fast/forms to fast/forms/select. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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: third_party/WebKit/LayoutTests/fast/forms/add-and-remove-option.html
diff --git a/third_party/WebKit/LayoutTests/fast/forms/add-and-remove-option.html b/third_party/WebKit/LayoutTests/fast/forms/add-and-remove-option.html
deleted file mode 100644
index 57df475b0e7c33e7b3dd62dd2a1bd1fb09d5b0c2..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/fast/forms/add-and-remove-option.html
+++ /dev/null
@@ -1,71 +0,0 @@
-<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=13287">bug 13287</a>:
-Cannot change SELECT to a dynamically created option.</p>
-<p>Test that DOM is updated before DOMNodeInserted is dispatched.</p>
-<form>
-<select ><option selected>1</option><option >2</option></select>
-<select multiple><option selected>1</option><option >2</option></select>
-<select size=5><option selected>1</option><option selected>2</option></select>
-</form>
-<div id=res></div>
-<script>
- if (window.testRunner)
- testRunner.dumpAsText();
-
- function log(msg)
- {
- var r = document.getElementById('res');
- r.innerHTML = r.innerHTML + "<br>" + msg;
- }
-
- var theSelect;
-
- function testResults(expectedArr)
- {
- var resultsArr = new Array(theSelect.options.length);
-
- var i;
- for (i=0; i < theSelect.options.length; i++) {
- resultsArr[i] = theSelect.options[i].selected;
- }
- var successString = "Failed";
- var success = false;
- if (expectedArr.join() == resultsArr.join()) {
- success = true;
- successString = "Passed";
- }
-
- log(successString);
- if (!success) {
- log("<pre> Expected: " + expectedArr.join() + "<br>" + " Actual: " + resultsArr.join() + "</pre>");
- }
- }
-
- function nodeInserted()
- {
- if (theSelect.options.length != 3)
- log("Incorrect options length: " + theSelect.options.length);
- theSelect.removeChild(theSelect.firstChild);
- if (theSelect.options.length != 2)
- log("Incorrect options length: " + theSelect.options.length);
- }
-
- try {
- theSelect = document.forms[0].elements[0];
- theSelect.addEventListener("DOMNodeInserted", nodeInserted, true);
- theSelect.options.add(new Option("3", "3", false, true), 0);
- testResults([true, false], theSelect);
-
- theSelect = document.forms[0].elements[1];
- theSelect.addEventListener("DOMNodeInserted", nodeInserted, true);
- theSelect.options.add(new Option("3", "3", false, true), 0);
- testResults([true, false], theSelect);
-
- theSelect = document.forms[0].elements[2];
- theSelect.addEventListener("DOMNodeInserted", nodeInserted, true);
- theSelect.insertBefore(new Option("3", "3", false, true), theSelect.firstChild);
- testResults([false, false], theSelect);
-
- } catch (ex) {
- alert(ex);
- }
-</script>

Powered by Google App Engine
This is Rietveld 408576698