Web Inspector: move Mac-specific automation commands to a separate implementation...
authorbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jan 2017 17:52:36 +0000 (17:52 +0000)
committerbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jan 2017 17:52:36 +0000 (17:52 +0000)
commit7bb926a4ccd766f34388cd9ee7b255b10845b348
tree53182b7d4c548dc479721e869f2798a1d29968b1
parent65953dac9fa7c0eaeda45da82149c8a1fd0343d5
Web Inspector: move Mac-specific automation commands to a separate implementation file
https://bugs.webkit.org/show_bug.cgi?id=163297
<rdar://problem/28718990>

Reviewed by Timothy Hatcher.

Not all Automation commands are available on all platforms. Start splitting out
command declarations and implementations based on the target platform.

* DerivedSources.make:
Set an appropriate --platform so the correct backend interface is generated.

* UIProcess/Automation/Automation.json:
Guard commands that should not be available on iOS:
    - resizeWindowOfBrowsingContext
    - moveWindowOfBrowsingContext
    - inspectBrowsingContext

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::platformSimulateKeySequence): Deleted.
- Move shared convenience macros to header file.
- Move out Cocoa-only or Mac-only command implementations.

* UIProcess/Automation/WebAutomationSession.h:
Rearrange some declarations and switch from USE(APPKIT) to PLATFORM(MAC).

* UIProcess/Automation/WebAutomationSessionMacros.h: Added.

* UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm: Added.
(WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
Moved from WebAutomationSessionCocoa.mm. Add iOS-specific header includes.

* UIProcess/Automation/mac/WebAutomationSessionMac.mm: Renamed from Source/WebKit2/UIProcess/Cocoa/WebAutomationSessionCocoa.mm.
(WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
(WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
(WebKit::WebAutomationSession::inspectBrowsingContext):
Move macOS platform command implementations to here. If other desktop ports want
to use these commands, we can move them somewhere else later.

(WebKit::WebAutomationSession::sendSynthesizedEventsToPage):
(WebKit::WebAutomationSession::markEventAsSynthesizedForAutomation):
(WebKit::WebAutomationSession::wasEventSynthesizedForAutomation):
Move out AppKit-specific event simulation code to here.

(WebKit::WebAutomationSession::platformSimulateMouseInteraction):
(WebKit::WebAutomationSession::platformSimulateKeyStroke):
(WebKit::WebAutomationSession::platformSimulateKeySequence):
Move out Mac platformFoo implementations to here.

* WebKit2.xcodeproj/project.pbxproj:
- Added UIProcess/Automation/{mac,cocoa} groups.
- Add new platform-specific implementation files.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210927 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/DerivedSources.make
Source/WebKit2/UIProcess/Automation/Automation.json
Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp
Source/WebKit2/UIProcess/Automation/WebAutomationSession.h
Source/WebKit2/UIProcess/Automation/WebAutomationSessionMacros.h [new file with mode: 0644]
Source/WebKit2/UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm [new file with mode: 0644]
Source/WebKit2/UIProcess/Automation/mac/WebAutomationSessionMac.mm [moved from Source/WebKit2/UIProcess/Cocoa/WebAutomationSessionCocoa.mm with 84% similarity]
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj