Bug 169487 - [iOS WK2] Web Automation: implement platform methods for simulating keyboard events
Summary: [iOS WK2] Web Automation: implement platform methods for simulating keyboard ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brian Burg
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-03-10 15:27 PST by Brian Burg
Modified: 2017-03-16 14:49 PDT (History)
4 users (show)

See Also:


Attachments
Patch (23.45 KB, patch)
2017-03-13 10:06 PDT, Brian Burg
joepeck: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Burg 2017-03-10 15:27:48 PST
.
Comment 1 Brian Burg 2017-03-10 15:28:21 PST
<rdar://problem/28360564>
Comment 2 Brian Burg 2017-03-13 10:06:13 PDT
Created attachment 304264 [details]
Patch
Comment 3 Alex Christensen 2017-03-14 10:39:32 PDT
Comment on attachment 304264 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=304264&action=review

> Source/WebKit2/UIProcess/Automation/WebAutomationSession.h:175
> +#if PLATFORM(MAC) || PLATFORM(IOS)

This is what PLATFORM(COCOA) is for
Comment 4 Joseph Pecoraro 2017-03-14 11:11:47 PDT
Comment on attachment 304264 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=304264&action=review

r=me

> Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp:936
> +#if !PLATFORM(MAC) && !PLATFORM(IOS)

This could be !PLATFORM(COCOA)

> Source/WebKit2/UIProcess/Automation/WebAutomationSession.h:226
> +    // We don't platform keyboard events on iOS, so we need to track it ourselves.

Grammar: "We don't platform keyboard" is missing a word somewhere.

> Source/WebKit2/UIProcess/Automation/WebAutomationSession.h:227
> +    unsigned m_currentModifiers;

Initialize this to { 0 }.

> Source/WebKit2/UIProcess/Automation/ios/WebAutomationSessionIOS.mm:111
> +        return;

This should be break, not return.

> Source/WebKit2/UIProcess/Automation/ios/WebAutomationSessionIOS.mm:270
> +        [eventsToBeSent addObject:[[::WebEvent alloc] initWithKeyEventType:WebEventKeyDown timeStamp:CFAbsoluteTimeGetCurrent() characters:characters charactersIgnoringModifiers:characters modifiers:m_currentModifiers isRepeating:NO withFlags:inputFlags withInputManagerHint:nil keyCode:keyCode isTabKey:isTabKey]];

I suspect this code is not under ARC (you are using a RetainPtr above). So all of these [::WebEvent alloc] allocated objects in this patch should be autoreleased when put into the eventsToBeSent array.
Comment 5 Brian Burg 2017-03-16 14:49:37 PDT
Committed r214070: <http://trac.webkit.org/changeset/214070>