Changeset 219554 in webkit
- Timestamp:
- Jul 17, 2017 12:01:07 AM (7 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r219550 r219554 1 2017-07-16 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 Web Automation: FindNodes should throw an error in case of invalid strategy 4 https://bugs.webkit.org/show_bug.cgi?id=174497 5 6 Reviewed by Brian Burg. 7 8 We are currently returning null or empty list. According to the spec in 12.2 Find Element and 12.3 Find 9 Elements, step 4: "If location strategy is not present as a keyword in the table of location strategies, return 10 error with error code invalid argument.". 11 https://www.w3.org/TR/webdriver/#find-element. 12 13 This is causing test test_should_throw_an_error_if_user_passes_in_invalid_by_when_find_elements to fail. 14 15 * UIProcess/Automation/atoms/FindNodes.js: 16 (switch): Throw an error in case of unknown strategy. 17 * WebProcess/Automation/WebAutomationSessionProxy.cpp: 18 (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Handle InvalidParameter exceptions. 19 1 20 2017-07-16 Brady Eidson <beidson@apple.com> 2 21 -
trunk/Source/WebKit/UIProcess/Automation/atoms/FindNodes.js
r219388 r219554 53 53 break; 54 54 default: 55 // Unknown strategy. 56 callback(firstResultOnly ? null : []); 57 return; 55 // §12.2 Find Element and §12.3 Find Elements, step 4: If location strategy is not present as a keyword 56 // in the table of location strategies, return error with error code invalid argument. 57 // https://www.w3.org/TR/webdriver/#find-element 58 throw { name: "InvalidParameter", message: ("Unsupported locator strategy: " + strategy + ".") }; 58 59 } 59 60 -
trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp
r217041 r219554 274 274 errorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::NodeNotFound); 275 275 else if (exceptionName->string() == "InvalidElementState") 276 errorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::InvalidElementState); 276 errorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::InvalidElementState); 277 else if (exceptionName->string() == "InvalidParameter") 278 errorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::InvalidParameter); 277 279 278 280 JSValueRef messageValue = JSObjectGetProperty(context, const_cast<JSObjectRef>(exception), toJSString(ASCIILiteral("message")).get(), nullptr);
Note: See TracChangeset
for help on using the changeset viewer.