Changeset 197620 in webkit


Ignore:
Timestamp:
Mar 5, 2016 4:40:01 PM (8 years ago)
Author:
timothy@apple.com
Message:

Rename Automation protocol methods to use "BrowsingContext" instead of "Window".
Also flesh out the protocol commands more by adding switchToBrowsingContext
and return a BrowsingContextHandle for createBrowsingContext.

https://bugs.webkit.org/show_bug.cgi?id=154953
rdar://problem/24947489

Reviewed by Brian Burg.

  • UIProcess/Automation/Automation.json:
  • UIProcess/Automation/WebAutomationSession.cpp:

(WebKit::WebAutomationSession::getBrowsingContexts):
(WebKit::WebAutomationSession::createBrowsingContext):
(WebKit::WebAutomationSession::closeBrowsingContext):
(WebKit::WebAutomationSession::switchToBrowsingContext):
(WebKit::WebAutomationSession::getWindows): Deleted.
(WebKit::WebAutomationSession::openWindow): Deleted.
(WebKit::WebAutomationSession::closeWindow): Deleted.

  • UIProcess/Automation/WebAutomationSession.h:
Location:
trunk/Source/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r197614 r197620  
     12016-03-05  Timothy Hatcher  <timothy@apple.com>
     2
     3        Rename Automation protocol methods to use "BrowsingContext" instead of "Window".
     4        Also flesh out the protocol commands more by adding switchToBrowsingContext
     5        and return a BrowsingContextHandle for createBrowsingContext.
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=154953
     8        rdar://problem/24947489
     9
     10        Reviewed by Brian Burg.
     11
     12        * UIProcess/Automation/Automation.json:
     13        * UIProcess/Automation/WebAutomationSession.cpp:
     14        (WebKit::WebAutomationSession::getBrowsingContexts):
     15        (WebKit::WebAutomationSession::createBrowsingContext):
     16        (WebKit::WebAutomationSession::closeBrowsingContext):
     17        (WebKit::WebAutomationSession::switchToBrowsingContext):
     18        (WebKit::WebAutomationSession::getWindows): Deleted.
     19        (WebKit::WebAutomationSession::openWindow): Deleted.
     20        (WebKit::WebAutomationSession::closeWindow): Deleted.
     21        * UIProcess/Automation/WebAutomationSession.h:
     22
    1232016-03-05  Yusuke Suzuki  <utatane.tea@gmail.com>
    224
  • trunk/Source/WebKit2/UIProcess/Automation/Automation.json

    r196980 r197620  
    44    "types": [
    55        {
    6             "id": "OpaqueWindowHandle",
     6            "id": "BrowsingContextHandle",
    77            "type": "string",
    8             "description": "An opaque identifier for a window."
     8            "description": "An opaque identifier for a browsing context."
    99        },
    1010        {
    1111            "id": "ErrorMessage",
    1212            "type": "string",
     13            "description": "This enum contains predefined error messages that can be used to signal a well-defined error condition, such as a missing implementation, unknown window handle, and so forth. The backend signals one of these errors by using it as a prefix of the commands's error message (the errorString argument in generated C++ backend dispatchers). This will be reported to the frontend as a protocol error with a JSON-RPC error code of 'ServerError'. It is up to the frontend whether and how to deal with errors.",
    1314            "enum": [
     15                "InternalError",
     16                "WindowNotFound",
    1417                "NotImplemented"
    15             ],
    16             "description": "This enum contains predefined error messages that can be used to signal a well-defined error condition, such as a missing implementation, unknown window handle, and so forth. The backend signals one of these errors by using it as a prefix of the commands's error message (the errorString argument in generated C++ backend dispatchers). This will be reported to the frontend as a protocol error with a JSON-RPC error code of 'ServerError'. It is up to the frontend whether and how to deal with errors."
     18            ]
    1719        },
    1820        {
    19             "id": "BrowsingWindow",
     21            "id": "BrowsingContext",
    2022            "type": "object",
    2123            "description": "A handle representing an open window or tab in the automation session.",
    2224            "properties": [
    23                 { "name": "handle", "$ref": "OpaqueWindowHandle", "description": "Opaque handle for the window. Used as a key for window-related commands." },
    24                 { "name": "active", "type": "boolean", "description": "Whether the window is active at the time the command is handled." }
     25                { "name": "handle", "$ref": "BrowsingContextHandle", "description": "Opaque handle for a browsing context (window or tab). Used as a key for window-related commands." },
     26                { "name": "active", "type": "boolean", "description": "Whether the browsing context has focus at the time the command is handled." }
    2527            ]
    2628        }
     
    2830    "commands": [
    2931        {
    30             "name": "getWindows",
     32            "name": "getBrowsingContexts",
     33            "description": "Fetches information about all open browsing contexts (windows and tabs) in the automation session.",
    3134            "returns": [
    32                 { "name": "windows", "type": "array", "items": { "$ref": "BrowsingWindow"}, "description": "All known windows and tabs in the browsing session." }
    33             ],
    34             "description": "Gets information about all open windows and tabs in the automation session."
     35                { "name": "contexts", "type": "array", "items": { "$ref": "BrowsingContext" }, "description": "All known browsing contexts available to the session." }
     36            ]
    3537        },
    3638        {
    37             "name": "openWindow",
    38             "description": "Opens a new automation window in the current browsing context."
     39            "name": "createBrowsingContext",
     40            "description": "Opens a new browsing context in the automation session and makes it the active browsing context for user interaction. This command creates a browsing context in a new window rather than adding a tab to an existing window.",
     41            "returns": [
     42                { "name": "handle", "$ref": "BrowsingContextHandle", "description": "An opaque handle for the newly created browsing context." }
     43            ]
    3944        },
    4045        {
    41             "name": "closeWindow",
     46            "name": "closeBrowsingContext",
     47            "description": "Try to close the specified browsing context. This can trigger an unload prompt and thereafter succeed or fail.",
    4248            "parameters": [
    43                 { "name": "handle", "$ref": "OpaqueWindowHandle", "description": "The handle for the window that should be closed." }
    44             ],
    45             "description": "Closes the specified window."
     49                { "name": "handle", "$ref": "BrowsingContextHandle", "description": "The handle for the browsing context that should be closed." }
     50            ]
     51        },
     52        {
     53            "name": "switchToBrowsingContext",
     54            "description": "Activates the specified browsing context.",
     55            "parameters": [
     56                { "name": "handle", "$ref": "BrowsingContextHandle", "description": "The handle for the browsing context that should be made active." }
     57            ]
    4658        }
    4759    ]
  • trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp

    r196980 r197620  
    100100// Inspector::AutomationBackendDispatcherHandler API
    101101
    102 void WebAutomationSession::getWindows(Inspector::ErrorString& errorString, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Automation::BrowsingWindow>>& out_windows)
     102void WebAutomationSession::getBrowsingContexts(Inspector::ErrorString& errorString, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Automation::BrowsingContext>>& contexts)
    103103{
    104104    FAIL_WITH_PREDEFINED_ERROR_MESSAGE(NotImplemented);
    105105}
    106106
    107 void WebAutomationSession::openWindow(Inspector::ErrorString& errorString)
     107void WebAutomationSession::createBrowsingContext(Inspector::ErrorString& errorString, String* handle)
    108108{
    109109    FAIL_WITH_PREDEFINED_ERROR_MESSAGE(NotImplemented);
    110110}
    111111
    112 void WebAutomationSession::closeWindow(Inspector::ErrorString& errorString, const String& in_handle)
     112void WebAutomationSession::closeBrowsingContext(Inspector::ErrorString& errorString, const String& handle)
     113{
     114    FAIL_WITH_PREDEFINED_ERROR_MESSAGE(NotImplemented);
     115}
     116
     117void WebAutomationSession::switchToBrowsingContext(Inspector::ErrorString& errorString, const String& handle)
    113118{
    114119    FAIL_WITH_PREDEFINED_ERROR_MESSAGE(NotImplemented);
  • trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.h

    r197563 r197620  
    7272
    7373    // Inspector::AutomationBackendDispatcherHandler API
    74     void getWindows(Inspector::ErrorString&, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Automation::BrowsingWindow>>& out_windows) override;
    75     void openWindow(Inspector::ErrorString&) override;
    76     void closeWindow(Inspector::ErrorString&, const String& in_handle) override;
     74    void getBrowsingContexts(Inspector::ErrorString&, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Automation::BrowsingContext>>&) override;
     75    void createBrowsingContext(Inspector::ErrorString&, String*) override;
     76    void closeBrowsingContext(Inspector::ErrorString&, const String&) override;
     77    void switchToBrowsingContext(Inspector::ErrorString&, const String&) override;
    7778
    7879private:
Note: See TracChangeset for help on using the changeset viewer.