Title: [227513] releases/WebKitGTK/webkit-2.18
Revision
227513
Author
[email protected]
Date
2018-01-24 02:03:25 -0800 (Wed, 24 Jan 2018)

Log Message

Merge r227414 - WebDriver: several tests in imported/w3c/webdriver/tests/sessions/new_session/merge.py are failing
https://bugs.webkit.org/show_bug.cgi?id=180407

Reviewed by Carlos Alberto Lopez Perez.

Source/WebDriver:

This is actually a bug in the spec, see https://github.com/w3c/webdriver/issues/1203. It seems the idea in any
case is that we should check all the firstMatch capabilities before matching them, and return if there's any
error.

* WebDriverService.cpp:
(WebDriver::WebDriverService::mergeCapabilities const):
(WebDriver::WebDriverService::processCapabilities const):

WebDriverTests:

Remove expectations for tests that are passing now and update the bug number of the other ones referencing

* TestExpectations.json:

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.18/Source/WebDriver/ChangeLog (227512 => 227513)


--- releases/WebKitGTK/webkit-2.18/Source/WebDriver/ChangeLog	2018-01-24 10:03:20 UTC (rev 227512)
+++ releases/WebKitGTK/webkit-2.18/Source/WebDriver/ChangeLog	2018-01-24 10:03:25 UTC (rev 227513)
@@ -1,5 +1,20 @@
 2018-01-23  Carlos Garcia Campos  <[email protected]>
 
+        WebDriver: several tests in imported/w3c/webdriver/tests/sessions/new_session/merge.py are failing
+        https://bugs.webkit.org/show_bug.cgi?id=180407
+
+        Reviewed by Carlos Alberto Lopez Perez.
+
+        This is actually a bug in the spec, see https://github.com/w3c/webdriver/issues/1203. It seems the idea in any
+        case is that we should check all the firstMatch capabilities before matching them, and return if there's any
+        error.
+
+        * WebDriverService.cpp:
+        (WebDriver::WebDriverService::mergeCapabilities const):
+        (WebDriver::WebDriverService::processCapabilities const):
+
+2018-01-23  Carlos Garcia Campos  <[email protected]>
+
         WebDriver: test imported/w3c/webdriver/tests/sessions/new_session/response.py::test_timeouts fails
         https://bugs.webkit.org/show_bug.cgi?id=180412
 

Modified: releases/WebKitGTK/webkit-2.18/Source/WebDriver/WebDriverService.cpp (227512 => 227513)


--- releases/WebKitGTK/webkit-2.18/Source/WebDriver/WebDriverService.cpp	2018-01-24 10:03:20 UTC (rev 227512)
+++ releases/WebKitGTK/webkit-2.18/Source/WebDriver/WebDriverService.cpp	2018-01-24 10:03:25 UTC (rev 227513)
@@ -442,12 +442,8 @@
         result->setValue(it->key, RefPtr<JSON::Value>(it->value));
 
     auto firstMatchEnd = firstMatchCapabilities.end();
-    for (auto it = firstMatchCapabilities.begin(); it != firstMatchEnd; ++it) {
-        if (requiredCapabilities.find(it->key) != requiredEnd)
-            return nullptr;
-
+    for (auto it = firstMatchCapabilities.begin(); it != firstMatchEnd; ++it)
         result->setValue(it->key, RefPtr<JSON::Value>(it->value));
-    }
 
     return result;
 }
@@ -575,6 +571,18 @@
             completionHandler(CommandResult::fail(CommandResult::ErrorCode::InvalidArgument, String("Invalid firstMatch capabilities")));
             return nullptr;
         }
+
+        // Validate here that firstMatchCapabilities don't shadow alwaysMatchCapabilities.
+        auto requiredEnd = requiredCapabilities->end();
+        auto firstMatchEnd = firstMatchCapabilities->end();
+        for (auto it = firstMatchCapabilities->begin(); it != firstMatchEnd; ++it) {
+            if (requiredCapabilities->find(it->key) != requiredEnd) {
+                completionHandler(CommandResult::fail(CommandResult::ErrorCode::InvalidArgument,
+                    makeString("Invalid firstMatch capabilities: key ", it->key, " is present in alwaysMatch")));
+                return nullptr;
+            }
+        }
+
         // 5.2. Append validated capabilities to validated first match capabilities.
         validatedFirstMatchCapabilitiesList.uncheckedAppend(WTFMove(firstMatchCapabilities));
     }

Modified: releases/WebKitGTK/webkit-2.18/WebDriverTests/ChangeLog (227512 => 227513)


--- releases/WebKitGTK/webkit-2.18/WebDriverTests/ChangeLog	2018-01-24 10:03:20 UTC (rev 227512)
+++ releases/WebKitGTK/webkit-2.18/WebDriverTests/ChangeLog	2018-01-24 10:03:25 UTC (rev 227513)
@@ -1,5 +1,17 @@
 2018-01-23  Carlos Garcia Campos  <[email protected]>
 
+        WebDriver: several tests in imported/w3c/webdriver/tests/sessions/new_session/merge.py are failing
+        https://bugs.webkit.org/show_bug.cgi?id=180407
+
+        Reviewed by Carlos Alberto Lopez Perez.
+
+        Remove expectations for tests that are passing now and update the bug number of the other ones referencing
+        #180407.
+
+        * TestExpectations.json:
+
+2018-01-23  Carlos Garcia Campos  <[email protected]>
+
         WebDriver: test imported/w3c/webdriver/tests/sessions/new_session/response.py::test_timeouts fails
         https://bugs.webkit.org/show_bug.cgi?id=180412
 

Modified: releases/WebKitGTK/webkit-2.18/WebDriverTests/TestExpectations.json (227512 => 227513)


--- releases/WebKitGTK/webkit-2.18/WebDriverTests/TestExpectations.json	2018-01-24 10:03:20 UTC (rev 227512)
+++ releases/WebKitGTK/webkit-2.18/WebDriverTests/TestExpectations.json	2018-01-24 10:03:25 UTC (rev 227513)
@@ -193,17 +193,11 @@
     },
     "imported/w3c/webdriver/tests/sessions/new_session/merge.py": {
         "subtests": {
-            "test_merge_invalid[unhandledPromptBehavior-value1]": {
-                "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180407"}}
-            },
-            "test_merge_invalid[unhandledPromptBehavior-value2]": {
-                "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180407"}}
-            },
             "test_merge_platformName": {
-                "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180407"}}
+                "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/181984"}}
             },
             "test_merge_browserName": {
-                "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180407"}}
+                "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/181985"}}
             }
         }
     },
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to