Bug 47308 - Add regression tests for autocorrection panel
Summary: Add regression tests for autocorrection panel
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.6
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2010-10-06 15:23 PDT by Jia Pu
Modified: 2010-10-15 09:27 PDT (History)
5 users (show)

See Also:


Attachments
Proposed patch (v1) (277.41 KB, patch)
2010-10-06 17:08 PDT, Jia Pu
no flags Details | Formatted Diff | Diff
An example of textInputController.hasSpellingMarker() (1.71 KB, text/html)
2010-10-07 00:58 PDT, Hironori Bono
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jia Pu 2010-10-06 15:23:20 PDT
<rdar://problem/8521243>
Comment 1 Jia Pu 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.
Comment 2 WebKit Commit Bot 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>
Comment 3 WebKit Commit Bot 2010-10-06 19:10:16 PDT
All reviewed patches have been landed.  Closing bug.
Comment 4 Kent Tamura 2010-10-06 20:18:05 PDT
Why don't you use textInputController.hasSpellingMarker() ?
Comment 5 Jia Pu 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.
Comment 6 Kent Tamura 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.
Comment 7 Hironori Bono 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
Comment 8 Adam Roben (:aroben) 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.
Comment 9 Jia Pu 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?
Comment 10 Hironori Bono 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
Comment 11 Jia Pu 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.