WebDriver: matched capabilities should include setWindowRect
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Jan 2018 16:20:36 +0000 (16:20 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Jan 2018 16:20:36 +0000 (16:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=180411

Reviewed by Carlos Alberto Lopez Perez.

Source/WebDriver:

Handle setWindowRect in capabilities. It's always true for GTK and false for WPE.

* Capabilities.h:
* WebDriverService.cpp:
(WebDriver::WebDriverService::parseCapabilities const):
(WebDriver::WebDriverService::matchCapabilities const):
(WebDriver::WebDriverService::newSession):
* gtk/WebDriverServiceGtk.cpp:
(WebDriver::WebDriverService::platformCapabilities):
* wpe/WebDriverServiceWPE.cpp:
(WebDriver::WebDriverService::platformCapabilities):

WebDriverTests:

Change the bug number of test imported/w3c/webdriver/tests/sessions/new_session/response.py::test_resp_data,
since now it's failing due to missing timeouts value.

* TestExpectations.json:

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

Source/WebDriver/Capabilities.h
Source/WebDriver/ChangeLog
Source/WebDriver/WebDriverService.cpp
Source/WebDriver/gtk/WebDriverServiceGtk.cpp
Source/WebDriver/wpe/WebDriverServiceWPE.cpp
WebDriverTests/ChangeLog
WebDriverTests/TestExpectations.json

index 0d37468..1d22067 100644 (file)
@@ -57,6 +57,7 @@ struct Capabilities {
     std::optional<String> browserVersion;
     std::optional<String> platformName;
     std::optional<bool> acceptInsecureCerts;
+    std::optional<bool> setWindowRect;
     std::optional<Timeouts> timeouts;
     std::optional<PageLoadStrategy> pageLoadStrategy;
     std::optional<UnhandledPromptBehavior> unhandledPromptBehavior;
index 6818cc4..3e80205 100644 (file)
@@ -1,5 +1,24 @@
 2018-01-23  Carlos Garcia Campos  <cgarcia@igalia.com>
 
+        WebDriver: matched capabilities should include setWindowRect
+        https://bugs.webkit.org/show_bug.cgi?id=180411
+
+        Reviewed by Carlos Alberto Lopez Perez.
+
+        Handle setWindowRect in capabilities. It's always true for GTK and false for WPE.
+
+        * Capabilities.h:
+        * WebDriverService.cpp:
+        (WebDriver::WebDriverService::parseCapabilities const):
+        (WebDriver::WebDriverService::matchCapabilities const):
+        (WebDriver::WebDriverService::newSession):
+        * gtk/WebDriverServiceGtk.cpp:
+        (WebDriver::WebDriverService::platformCapabilities):
+        * wpe/WebDriverServiceWPE.cpp:
+        (WebDriver::WebDriverService::platformCapabilities):
+
+2018-01-23  Carlos Garcia Campos  <cgarcia@igalia.com>
+
         WebDriver: test imported/selenium/py/test/selenium/webdriver/common/api_example_tests.py::testChangeWindowSize fails
         https://bugs.webkit.org/show_bug.cgi?id=181728
 
index 903843d..013bc5a 100644 (file)
@@ -346,6 +346,9 @@ void WebDriverService::parseCapabilities(const JSON::Object& matchedCapabilities
     bool acceptInsecureCerts;
     if (matchedCapabilities.getBoolean(ASCIILiteral("acceptInsecureCerts"), acceptInsecureCerts))
         capabilities.acceptInsecureCerts = acceptInsecureCerts;
+    bool setWindowRect;
+    if (matchedCapabilities.getBoolean(ASCIILiteral("setWindowRect"), setWindowRect))
+        capabilities.setWindowRect = setWindowRect;
     String browserName;
     if (matchedCapabilities.getString(ASCIILiteral("browserName"), browserName))
         capabilities.browserName = browserName;
@@ -466,6 +469,8 @@ RefPtr<JSON::Object> WebDriverService::matchCapabilities(const JSON::Object& mer
         matchedCapabilities->setString(ASCIILiteral("platformName"), platformCapabilities.platformName.value());
     if (platformCapabilities.acceptInsecureCerts)
         matchedCapabilities->setBoolean(ASCIILiteral("acceptInsecureCerts"), platformCapabilities.acceptInsecureCerts.value());
+    if (platformCapabilities.setWindowRect)
+        matchedCapabilities->setBoolean(ASCIILiteral("setWindowRect"), platformCapabilities.setWindowRect.value());
 
     auto end = mergedCapabilities.end();
     for (auto it = mergedCapabilities.begin(); it != end; ++it) {
@@ -665,6 +670,8 @@ void WebDriverService::newSession(RefPtr<JSON::Object>&& parameters, Function<vo
                     break;
                 }
             }
+            if (capabilities.setWindowRect)
+                capabilitiesObject->setBoolean(ASCIILiteral("setWindowRect"), capabilities.setWindowRect.value());
             if (capabilities.unhandledPromptBehavior) {
                 switch (capabilities.unhandledPromptBehavior.value()) {
                 case UnhandledPromptBehavior::Dismiss:
index 8072c41..191342d 100644 (file)
@@ -37,6 +37,7 @@ Capabilities WebDriverService::platformCapabilities()
     Capabilities capabilities;
     capabilities.platformName = String("linux");
     capabilities.acceptInsecureCerts = false;
+    capabilities.setWindowRect = true;
     return capabilities;
 }
 
index 3cfa11f..608cb7c 100644 (file)
@@ -37,6 +37,7 @@ Capabilities WebDriverService::platformCapabilities()
     Capabilities capabilities;
     capabilities.platformName = String("linux");
     capabilities.acceptInsecureCerts = false;
+    capabilities.setWindowRect = false;
     return capabilities;
 }
 
index 3a076b2..71908a2 100644 (file)
@@ -1,5 +1,17 @@
 2018-01-23  Carlos Garcia Campos  <cgarcia@igalia.com>
 
+        WebDriver: matched capabilities should include setWindowRect
+        https://bugs.webkit.org/show_bug.cgi?id=180411
+
+        Reviewed by Carlos Alberto Lopez Perez.
+
+        Change the bug number of test imported/w3c/webdriver/tests/sessions/new_session/response.py::test_resp_data,
+        since now it's failing due to missing timeouts value.
+
+        * TestExpectations.json:
+
+2018-01-23  Carlos Garcia Campos  <cgarcia@igalia.com>
+
         WebDriver: test imported/selenium/py/test/selenium/webdriver/common/api_example_tests.py::testChangeWindowSize fails
         https://bugs.webkit.org/show_bug.cgi?id=181728
 
index bd17506..0255a14 100644 (file)
                 "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180408"}}
             },
             "test_resp_data": {
-                "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180411"}}
+                "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180412"}}
             },
             "test_timeouts": {
                 "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/180412"}}