Bug 14710

Summary: DumpRenderTree needs to be able to test Input Method behaviour
Product: WebKit Reporter: Oliver Hunt <oliver>
Component: Tools / TestsAssignee: Oliver Hunt <oliver>
Status: RESOLVED FIXED    
Severity: Normal CC: ap
Priority: P2    
Version: 523.x (Safari 3)   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
Woo, an ability to test input method behaviour!!!!!
ap: review-
Mark 2, this time without repeating a lot of code i wish i had realised was there
darin: review+
Move current IM tests to editing/input/mac, update skip lists sam: review+

Oliver Hunt
Reported 2007-07-22 03:35:15 PDT
Due to the continual breakage and unbreakage of Input Methods I have been going mad. We really need some ability to ensure we don't continually regress Input Method behaviour, eg. DRT needs to support IM tests.
Attachments
Woo, an ability to test input method behaviour!!!!! (17.74 KB, patch)
2007-07-22 03:45 PDT, Oliver Hunt
ap: review-
Mark 2, this time without repeating a lot of code i wish i had realised was there (15.30 KB, patch)
2007-07-22 08:15 PDT, Oliver Hunt
darin: review+
Move current IM tests to editing/input/mac, update skip lists (7.36 KB, patch)
2007-07-22 14:00 PDT, Oliver Hunt
sam: review+
Oliver Hunt
Comment 1 2007-07-22 03:45:03 PDT
Created attachment 15617 [details] Woo, an ability to test input method behaviour!!!!!
Alexey Proskuryakov
Comment 2 2007-07-22 04:19:49 PDT
Comment on attachment 15617 [details] Woo, an ability to test input method behaviour!!!!! + * ChangeLog: This needn't be in the ChangeLog. + (-[InputMethodController setIMEFunction:]): I'd call this setIMEventHandler. Generally, it would be nice not to say "IME" in Mac code. Index: DumpRenderTree/InputMethodController.h Would it make sense to implement this within TextInputContoller, which already has NSTextInput methods? We seem to get quite a bit of code duplication. + WebScriptObject *imeFunction; + WebHTMLView *view; Coding style: please prefix Objective-C instance variables with "_". + WebScriptObject *modifiers = [imeFunction evaluateWebScript:@"new Array();"]; I think you can work with an NSArray, and converted to WebScriptObject later - the current code doesn't look nice. Mark had more to say about that on IRC. r- mostly because of code duplication.
Oliver Hunt
Comment 3 2007-07-22 08:15:48 PDT
Created attachment 15622 [details] Mark 2, this time without repeating a lot of code i wish i had realised was there Here we go again
Oliver Hunt
Comment 4 2007-07-22 08:19:24 PDT
Alas I can't use NSDictionary as it doesn't get mapped into a usable JS object, so the Event structure is still a damnable WebScriptObject. I'm thinking the best approach the the IMs is to build up <IMengine.js> for whatever engines we have bugs against, and as time goes by incorporate more of each IMs behaviour into the scripts.
Darin Adler
Comment 5 2007-07-22 08:47:08 PDT
Comment on attachment 15622 [details] Mark 2, this time without repeating a lot of code i wish i had realised was there Seems like a great start for testing this sort of thing. My one suggestion would be to have more of this done with an eye toward future platform-independence, for example leaving the "NS" out of the string constants for our JavaScript API. r=me
Alexey Proskuryakov
Comment 6 2007-07-22 12:45:11 PDT
A minor comment: earlier NSTextInput tests are in editing/input, I think the test from this patch can go there, too.
Oliver Hunt
Comment 7 2007-07-22 12:51:05 PDT
Landed in r r24517 Without Alexeys test location, as his comment came though just as i committed, is it really worth moving them? :-/
Alexey Proskuryakov
Comment 8 2007-07-22 13:05:45 PDT
Well, there doesn't seem to be any reason to have two directories for these tests :(
Oliver Hunt
Comment 9 2007-07-22 13:07:37 PDT
I have a reason: I can just add the entire inputmethods directory to the windows skiplist In future we may need to have intputmethods/mac and inputmethods/win in which case keeping them isolated will be beneficial
Alexey Proskuryakov
Comment 10 2007-07-22 13:12:04 PDT
Maybe editing/input/mac will do then?
Oliver Hunt
Comment 11 2007-07-22 13:31:31 PDT
I would prefer to keep them completely seperate from the other input methods ... how about events/input (as you say) and events/input/inputengines/<engine, eg. kotoeri>/<platform> If we could come up with someway of getting the right engine for the platform it would be great and then just have a generic test with a non-generic engine implementation...
Alexey Proskuryakov
Comment 12 2007-07-22 13:45:34 PDT
(In reply to comment #11) > events/input (as you say) More precisely, editing/input > and events/input/inputengines/<engine, eg. kotoeri>/<platform> I'm not quite convinced that most of these tests will be engine-based, but I'm OK with trying such a structure.
Oliver Hunt
Comment 13 2007-07-22 13:53:26 PDT
Well i'm assuming that we'll be making tests to ensure we don't regress various IM engines, so engines would contain (for example) kotoeri.js, and hangul.js, because otherwise whenever you want to test something you putting quite a bit of effort just to ensure the rest of the IM behaviour is correct. For now editing/input/mac would do, but i'm trying to think of the future
Oliver Hunt
Comment 14 2007-07-22 14:00:20 PDT
Created attachment 15627 [details] Move current IM tests to editing/input/mac, update skip lists
Oliver Hunt
Comment 15 2007-07-22 14:14:22 PDT
Moved tests in r24522
Note You need to log in before you can comment on or make changes to this bug.