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

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/the-form-element/form-indexed-element.html

Issue 2408493002: Import wpt@357b83b809e3cbc7a1805e7c3ca108a7980d782f (Closed)
Patch Set: Added one more win7-specific baseline Created 4 years, 2 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: third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/the-form-element/form-indexed-element.html
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/the-form-element/form-indexed-element.html b/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/the-form-element/form-indexed-element.html
index 44471aa8ca309675167584f8b63d6de6e16162b4..66f00e7615d59d1649b9793f3d475bc7ce39b810 100644
--- a/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/the-form-element/form-indexed-element.html
+++ b/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/the-form-element/form-indexed-element.html
@@ -18,5 +18,28 @@ test(function() {
assert_equals(form[1], document.getElementById("r2"));
assert_equals(form[2], undefined);
assert_equals(form[-1], undefined);
- }, "form.elements should be accessed correctly by index")
+}, "form.elements should be accessed correctly by index")
+
+test(function(){
+ var form = document.getElementById("form");
+ var old_item = form[0];
+ var old_desc = Object.getOwnPropertyDescriptor(form, 0);
+ assert_equals(old_desc.value, old_item);
+ assert_true(old_desc.enumerable);
+ assert_true(old_desc.configurable);
+ assert_false(old_desc.writable);
+
+ Object.prototype[0] = 5;
+ this.add_cleanup(function () { delete Object.prototype[0]; });
+ assert_equals(form[0], old_item);
+
+ delete form[0];
+ assert_equals(form[0], old_item);
+
+ assert_throws(new TypeError(), function() {
+ "use strict";
+ delete form[0];
+ });
+ assert_equals(form[0], old_item);
+}, 'Trying to delete an indexed property name should never work');
</script>

Powered by Google App Engine
This is Rietveld 408576698