WebDriver: unknown capabilities should produce an InvalidArgument error when validati...
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Oct 2017 07:13:11 +0000 (07:13 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Oct 2017 07:13:11 +0000 (07:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=178868

Reviewed by Brian Burg.

7.2 Processing Capabilities
https://w3c.github.io/webdriver/webdriver-spec.html#dfn-validate-capabilities

Fixes: imported/w3c/webdriver/tests/sessions/new_session/invalid_capabilities.py::test_invalid_extensions

* WebDriverService.cpp:
(WebDriver::WebDriverService::validatedCapabilities const):

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

Source/WebDriver/ChangeLog
Source/WebDriver/WebDriverService.cpp

index eace953..0d0ab81 100644 (file)
@@ -1,5 +1,20 @@
 2017-10-27  Carlos Garcia Campos  <cgarcia@igalia.com>
 
+        WebDriver: unknown capabilities should produce an InvalidArgument error when validating capabilities
+        https://bugs.webkit.org/show_bug.cgi?id=178868
+
+        Reviewed by Brian Burg.
+
+        7.2 Processing Capabilities
+        https://w3c.github.io/webdriver/webdriver-spec.html#dfn-validate-capabilities
+
+        Fixes: imported/w3c/webdriver/tests/sessions/new_session/invalid_capabilities.py::test_invalid_extensions
+
+        * WebDriverService.cpp:
+        (WebDriver::WebDriverService::validatedCapabilities const):
+
+2017-10-27  Carlos Garcia Campos  <cgarcia@igalia.com>
+
         WebDriver: deserializeTimeouts should fail if the value is not integer
         https://bugs.webkit.org/show_bug.cgi?id=178866
 
index bbc20c5..a832b4a 100644 (file)
@@ -404,7 +404,8 @@ RefPtr<InspectorObject> WebDriverService::validatedCapabilities(const InspectorO
             if (!platformValidateCapability(it->key, it->value))
                 return nullptr;
             result->setValue(it->key, RefPtr<InspectorValue>(it->value));
-        }
+        } else
+            return nullptr;
     }
     return result;
 }