Bug 22371 - Add a test for accessing form element items by index
Summary: Add a test for accessing form element items by index
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Pam Greene (IRC:pamg)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-19 17:49 PST by Pam Greene (IRC:pamg)
Modified: 2008-11-20 15:52 PST (History)
0 users

See Also:


Attachments
New test + result (1.92 KB, patch)
2008-11-19 18:02 PST, Pam Greene (IRC:pamg)
darin: review+
Details | Formatted Diff | Diff
Test using the JS test wrapper (2.16 KB, patch)
2008-11-20 11:06 PST, Pam Greene (IRC:pamg)
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pam Greene (IRC:pamg) 2008-11-19 17:49:45 PST
This applies to things like radio-button options.
Comment 1 Pam Greene (IRC:pamg) 2008-11-19 18:02:50 PST
Created attachment 25296 [details]
New test + result

Simple test, but apparently it wasn't directly covered by any others when we noticed the need.
Comment 2 Darin Adler 2008-11-20 07:44:30 PST
Comment on attachment 25296 [details]
New test + result

Tests like this should be written with the JavaScript test wrapper whenever possible. Also, it's helpful to test more than just the fact that a value is not undefined when testing something like this.

For an example, look at something like fast/dom/HTMLFormElement/elements-not-in-document.html -- tests like that one are more valuable.

r=me
Comment 3 Pam Greene (IRC:pamg) 2008-11-20 11:06:39 PST
Created attachment 25319 [details]
Test using the JS test wrapper

I'd rather not rewrite all 86 tests to use the wrapper, but only testing against undefined was indeed pretty lame.
Comment 4 Darin Adler 2008-11-20 11:41:18 PST
Comment on attachment 25319 [details]
Test using the JS test wrapper

I wasn't aware there were 86 tests.

I guess that's the downside of getting review only after writing all the tests. I try to make the comments promptly so they can be dealt with early.

r=me
Comment 5 Pam Greene (IRC:pamg) 2008-11-20 12:29:11 PST
(In reply to comment #4)
> (From update of attachment 25319 [details] [review])
> I wasn't aware there were 86 tests.

That's a quick grep count; call it +/- 10, with resources and such.

> I guess that's the downside of getting review only after writing all the tests.
> I try to make the comments promptly so they can be dealt with early.

Absolutely, and I certainly appreciate your quick and understanding reviews.

There are several downsides to trying to submit tests that were written by other people for problems that were fixed long ago, but hopefully having the tests at all is still worthwhile.
Comment 6 Pam Greene (IRC:pamg) 2008-11-20 15:52:17 PST
Landed in r38640.