RESOLVED FIXED47308
Add regression tests for autocorrection panel
https://bugs.webkit.org/show_bug.cgi?id=47308
Summary Add regression tests for autocorrection panel
Jia Pu
Reported 2010-10-06 15:23:20 PDT
Attachments
Proposed patch (v1) (277.41 KB, patch)
2010-10-06 17:08 PDT, Jia Pu
no flags
An example of textInputController.hasSpellingMarker() (1.71 KB, text/html)
2010-10-07 00:58 PDT, Hironori Bono
no flags
Jia Pu
Comment 1 2010-10-06 17:08:44 PDT
Created attachment 70016 [details] Proposed patch (v1) This patch contains following tests: 1. Verify the autocorrection is applied, and autocorrected word has blue underline. 2. Blue underline is removed when a paragraph separator is inserted either by typing or by copy-and-paste'ing. 3. Autocorrection is not applied to word that is first autocorrected, then subsequently modified by user. Not every aspect of autocorrection panel is readily testable. Please see corresponding Radar for detailed explanation.
WebKit Commit Bot
Comment 2 2010-10-06 19:10:11 PDT
Comment on attachment 70016 [details] Proposed patch (v1) Clearing flags on attachment: 70016 Committed r69269: <http://trac.webkit.org/changeset/69269>
WebKit Commit Bot
Comment 3 2010-10-06 19:10:16 PDT
All reviewed patches have been landed. Closing bug.
Kent Tamura
Comment 4 2010-10-06 20:18:05 PDT
Why don't you use textInputController.hasSpellingMarker() ?
Jia Pu
Comment 5 2010-10-06 22:05:25 PDT
(In reply to comment #4) > Why don't you use textInputController.hasSpellingMarker() ? Kent, that's good point. I wasn't aware of the existence of this object. In fact, I have difficulty locating it's definition. Could you tell me the meaning of the two arguments? Thanks.
Kent Tamura
Comment 6 2010-10-06 22:20:43 PDT
(In reply to comment #5) > > Why don't you use textInputController.hasSpellingMarker() ? > > Kent, that's good point. I wasn't aware of the existence of this object. In fact, I have difficulty locating it's definition. Could you tell me the meaning of the two arguments? Thanks. I think they are the starting offset and the length in the focused node.
Hironori Bono
Comment 7 2010-10-07 00:58:57 PDT
Created attachment 70047 [details] An example of textInputController.hasSpellingMarker() Greetings, I have a little changed one of your new layout tests "autocorrection-delete.html" as an example how to use textInputController.hasSpellingMarker(). I wish it helps. Regards, Hironori Bono
Adam Roben (:aroben)
Comment 8 2010-10-07 05:47:58 PDT
These tests fail on Windows (and probably shouldn't be running there at all). I filed bug bug 47341.
Jia Pu
Comment 9 2010-10-14 10:09:12 PDT
(In reply to comment #4) > Why don't you use textInputController.hasSpellingMarker() ? It seems hasSpellingMarker() only look for marker whose value is "Spelling". What is needed for these test is a more generic function that allows testing for arbitrary marker value, since the implementation of autocorrection uses two newly added marker values. I don't suppose this is very difficult to do, yes?
Hironori Bono
Comment 10 2010-10-14 22:51:41 PDT
(In reply to comment #9) > It seems hasSpellingMarker() only look for marker whose value is "Spelling". What is needed for these test is a more generic function that allows testing for arbitrary marker value, since the implementation of autocorrection uses two newly added marker values. > > I don't suppose this is very difficult to do, yes? Even though it is not so hard to support non-Spelling markers (such as grammar markers), it is not so easy to write its layout tests. (Are there any existing layout tests for grammar markers?) Regards, Hironori Bono
Jia Pu
Comment 11 2010-10-15 09:27:40 PDT
> > Even though it is not so hard to support non-Spelling markers (such as grammar markers), it is not so easy to write its layout tests. (Are there any existing layout tests for grammar markers?) > I don't see existing tests for grammar markers. The autocorrection related markers behaves similarly to spell checking marker. It shouldn't be too difficult to write tests. Of course, this is Mac-only at this moment. I have filed a request in bug 47705. We could carry the discussion forward over there.
Note You need to log in before you can comment on or make changes to this bug.