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

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/the-select-element/common-HTMLOptionsCollection.html

Issue 2468053002: Import wpt@9fcccf38b6be00f71ffa6bd6e29c5aa1ef25ee8c (Closed)
Patch Set: Skip cssom and svg/shapes, remove unwanted baseline Created 4 years, 1 month 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/imported/wpt/html/semantics/forms/the-select-element/common-HTMLOptionsCollection.html
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/the-select-element/common-HTMLOptionsCollection.html b/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/the-select-element/common-HTMLOptionsCollection.html
index 6bae66ccf7850b689af8c7d5e5c4817c88cb1e37..307b73f8722b372204085d279fd7e47e27d0f730 100644
--- a/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/the-select-element/common-HTMLOptionsCollection.html
+++ b/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/the-select-element/common-HTMLOptionsCollection.html
@@ -67,4 +67,33 @@ test(function () {
assert_equals(selly.children.length, 4,
"Number of children should have changed");
}, "Setting a length lower than the old length trims nodes from the end");
+
+test(function () {
+ var opts = selly.options;
+ opts[3] = null;
+ assert_equals(selly[3], undefined,
+ "previously set node is now undefined");
+ assert_equals(selly.length, 3,
+ "Number of nodes in collection is correctly changed");
+ assert_equals(selly.children.length, 3,
+ "Number of children should have changed");
+}, "Setting element to null by index removed the element");
+
+test(function () {
+ var opts = selly.options;
+ var new_option = document.createElement("option");
+ var replace_option = new_option.cloneNode(true);
+ new_option.value = "-1";
+ replace_option.value = "a";
+ opts[5] = new_option;
+ opts[0] = replace_option;
+
+ var elarray = [];
+ for (var i = 0; i < selly.length; i++) {
+ elarray.push(selly[i].value);
+ }
+ assert_array_equals(elarray, ["a", "2", "3", "", "", "-1"]);
+
+}, "Setting element by index should correctly append and replace elements");
+
</script>

Powered by Google App Engine
This is Rietveld 408576698