Changeset 227414 in webkit


Ignore:
Timestamp:
Jan 23, 2018 8:22:55 AM (6 years ago)
Author:
Carlos Garcia Campos
Message:

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
#180407.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebDriver/ChangeLog

    r227413 r227414  
     12018-01-23  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        WebDriver: several tests in imported/w3c/webdriver/tests/sessions/new_session/merge.py are failing
     4        https://bugs.webkit.org/show_bug.cgi?id=180407
     5
     6        Reviewed by Carlos Alberto Lopez Perez.
     7
     8        This is actually a bug in the spec, see https://github.com/w3c/webdriver/issues/1203. It seems the idea in any
     9        case is that we should check all the firstMatch capabilities before matching them, and return if there's any
     10        error.
     11
     12        * WebDriverService.cpp:
     13        (WebDriver::WebDriverService::mergeCapabilities const):
     14        (WebDriver::WebDriverService::processCapabilities const):
     15
    1162018-01-23  Carlos Garcia Campos  <cgarcia@igalia.com>
    217
  • trunk/Source/WebDriver/WebDriverService.cpp

    r227413 r227414  
    443443
    444444    auto firstMatchEnd = firstMatchCapabilities.end();
    445     for (auto it = firstMatchCapabilities.begin(); it != firstMatchEnd; ++it) {
    446         if (requiredCapabilities.find(it->key) != requiredEnd)
    447             return nullptr;
    448 
     445    for (auto it = firstMatchCapabilities.begin(); it != firstMatchEnd; ++it)
    449446        result->setValue(it->key, RefPtr<JSON::Value>(it->value));
    450     }
    451447
    452448    return result;
     
    576572            return nullptr;
    577573        }
     574
     575        // Validate here that firstMatchCapabilities don't shadow alwaysMatchCapabilities.
     576        auto requiredEnd = requiredCapabilities->end();
     577        auto firstMatchEnd = firstMatchCapabilities->end();
     578        for (auto it = firstMatchCapabilities->begin(); it != firstMatchEnd; ++it) {
     579            if (requiredCapabilities->find(it->key) != requiredEnd) {
     580                completionHandler(CommandResult::fail(CommandResult::ErrorCode::InvalidArgument,
     581                    makeString("Invalid firstMatch capabilities: key ", it->key, " is present in alwaysMatch")));
     582                return nullptr;
     583            }
     584        }
     585
    578586        // 5.2. Append validated capabilities to validated first match capabilities.
    579587        validatedFirstMatchCapabilitiesList.uncheckedAppend(WTFMove(firstMatchCapabilities));
  • trunk/WebDriverTests/ChangeLog

    r227413 r227414  
     12018-01-23  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        WebDriver: several tests in imported/w3c/webdriver/tests/sessions/new_session/merge.py are failing
     4        https://bugs.webkit.org/show_bug.cgi?id=180407
     5
     6        Reviewed by Carlos Alberto Lopez Perez.
     7
     8        Remove expectations for tests that are passing now and update the bug number of the other ones referencing
     9        #180407.
     10
     11        * TestExpectations.json:
     12
    1132018-01-23  Carlos Garcia Campos  <cgarcia@igalia.com>
    214
  • trunk/WebDriverTests/TestExpectations.json

    r227413 r227414  
    194194    "imported/w3c/webdriver/tests/sessions/new_session/merge.py": {
    195195        "subtests": {
    196             "test_merge_invalid[unhandledPromptBehavior-value1]": {
    197                 "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180407"}}
    198             },
    199             "test_merge_invalid[unhandledPromptBehavior-value2]": {
    200                 "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180407"}}
    201             },
    202196            "test_merge_platformName": {
    203                 "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180407"}}
     197                "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/181984"}}
    204198            },
    205199            "test_merge_browserName": {
    206                 "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180407"}}
     200                "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/181985"}}
    207201            }
    208202        }
Note: See TracChangeset for help on using the changeset viewer.