Changeset 197620 in webkit
- Timestamp:
- Mar 5, 2016 4:40:01 PM (8 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r197614 r197620 1 2016-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 1 23 2016-03-05 Yusuke Suzuki <utatane.tea@gmail.com> 2 24 -
trunk/Source/WebKit2/UIProcess/Automation/Automation.json
r196980 r197620 4 4 "types": [ 5 5 { 6 "id": " OpaqueWindowHandle",6 "id": "BrowsingContextHandle", 7 7 "type": "string", 8 "description": "An opaque identifier for a window."8 "description": "An opaque identifier for a browsing context." 9 9 }, 10 10 { 11 11 "id": "ErrorMessage", 12 12 "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.", 13 14 "enum": [ 15 "InternalError", 16 "WindowNotFound", 14 17 "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 ] 17 19 }, 18 20 { 19 "id": "Browsing Window",21 "id": "BrowsingContext", 20 22 "type": "object", 21 23 "description": "A handle representing an open window or tab in the automation session.", 22 24 "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 activeat 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." } 25 27 ] 26 28 } … … 28 30 "commands": [ 29 31 { 30 "name": "getWindows", 32 "name": "getBrowsingContexts", 33 "description": "Fetches information about all open browsing contexts (windows and tabs) in the automation session.", 31 34 "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 ] 35 37 }, 36 38 { 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 ] 39 44 }, 40 45 { 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.", 42 48 "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 ] 46 58 } 47 59 ] -
trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp
r196980 r197620 100 100 // Inspector::AutomationBackendDispatcherHandler API 101 101 102 void WebAutomationSession::get Windows(Inspector::ErrorString& errorString, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Automation::BrowsingWindow>>& out_windows)102 void WebAutomationSession::getBrowsingContexts(Inspector::ErrorString& errorString, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Automation::BrowsingContext>>& contexts) 103 103 { 104 104 FAIL_WITH_PREDEFINED_ERROR_MESSAGE(NotImplemented); 105 105 } 106 106 107 void WebAutomationSession:: openWindow(Inspector::ErrorString& errorString)107 void WebAutomationSession::createBrowsingContext(Inspector::ErrorString& errorString, String* handle) 108 108 { 109 109 FAIL_WITH_PREDEFINED_ERROR_MESSAGE(NotImplemented); 110 110 } 111 111 112 void WebAutomationSession::closeWindow(Inspector::ErrorString& errorString, const String& in_handle) 112 void WebAutomationSession::closeBrowsingContext(Inspector::ErrorString& errorString, const String& handle) 113 { 114 FAIL_WITH_PREDEFINED_ERROR_MESSAGE(NotImplemented); 115 } 116 117 void WebAutomationSession::switchToBrowsingContext(Inspector::ErrorString& errorString, const String& handle) 113 118 { 114 119 FAIL_WITH_PREDEFINED_ERROR_MESSAGE(NotImplemented); -
trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.h
r197563 r197620 72 72 73 73 // 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; 77 78 78 79 private:
Note: See TracChangeset
for help on using the changeset viewer.