WebDriver: get active element should return no such element error when there isn...
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Dec 2017 08:30:25 +0000 (08:30 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Dec 2017 08:30:25 +0000 (08:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=180421

Reviewed by Brian Burg.

We currently return unknown error.

Fixes: imported/w3c/webdriver/tests/element_retrieval/get_active_element.py::test_missing_document_element
* Session.cpp:
(WebDriver::Session::getActiveElement):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225739 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebDriver/ChangeLog
Source/WebDriver/Session.cpp

index 2d41eb4a215701b6aa42920381fca6c0d4b8020c..ae2258e69ba8fb5b5915ba52a316ca5704aa0e7f 100644 (file)
@@ -1,3 +1,17 @@
+2017-12-11  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        WebDriver: get active element should return no such element error when there isn't an active element
+        https://bugs.webkit.org/show_bug.cgi?id=180421
+
+        Reviewed by Brian Burg.
+
+        We currently return unknown error.
+
+        Fixes: imported/w3c/webdriver/tests/element_retrieval/get_active_element.py::test_missing_document_element
+
+        * Session.cpp:
+        (WebDriver::Session::getActiveElement):
+
 2017-12-04  Brian Burg  <bburg@apple.com>
 
         Web Automation: add flag to preserve legacy page screenshot behavior
index 54b472e66f087989d7064e9e1fa99aaae3e0ab05..b4696d0978cdb7569178cfeb5d2d1557e94de0a8 100644 (file)
@@ -996,7 +996,7 @@ void Session::getActiveElement(Function<void (CommandResult&&)>&& completionHand
             }
             RefPtr<JSON::Object> elementObject = createElement(WTFMove(resultValue));
             if (!elementObject) {
-                completionHandler(CommandResult::fail(CommandResult::ErrorCode::UnknownError));
+                completionHandler(CommandResult::fail(CommandResult::ErrorCode::NoSuchElement));
                 return;
             }
             completionHandler(CommandResult::success(WTFMove(elementObject)));