Changeset 254330 in webkit


Ignore:
Timestamp:
Jan 10, 2020 12:45:56 AM (4 years ago)
Author:
Carlos Garcia Campos
Message:

Automation: resolveChildFrameWithNodeHandle should return NodeNotFound when node doesn't exist
https://bugs.webkit.org/show_bug.cgi?id=205993

Reviewed by Brian Burg.

According to the spec:

"If element is stale, return error with error code stale element reference."
https://w3c.github.io/webdriver/#switch-to-frame

Fixes: imported/w3c/webdriver/tests/switch_to_frame/switch.py::test_frame_id_webelement_stale_reference

  • WebProcess/Automation/WebAutomationSessionProxy.cpp:

(WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r254329 r254330  
     12020-01-10  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        Automation: resolveChildFrameWithNodeHandle should return NodeNotFound when node doesn't exist
     4        https://bugs.webkit.org/show_bug.cgi?id=205993
     5
     6        Reviewed by Brian Burg.
     7
     8        According to the spec:
     9
     10        "If element is stale, return error with error code stale element reference."
     11        https://w3c.github.io/webdriver/#switch-to-frame
     12
     13        Fixes: imported/w3c/webdriver/tests/switch_to_frame/switch.py::test_frame_id_webelement_stale_reference
     14
     15        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
     16        (WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle):
     17
    1182020-01-10  Carlos Garcia Campos  <cgarcia@igalia.com>
    219
  • trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp

    r254329 r254330  
    440440
    441441    WebCore::Element* coreElement = elementForNodeHandle(*frame, nodeHandle);
     442    if (!coreElement) {
     443        String nodeNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::NodeNotFound);
     444        completionHandler(nodeNotFoundErrorType, WTF::nullopt);
     445        return;
     446    }
     447
    442448    if (!is<WebCore::HTMLFrameElementBase>(coreElement)) {
    443449        completionHandler(frameNotFoundErrorType, WTF::nullopt);
Note: See TracChangeset for help on using the changeset viewer.