Title: [252408] trunk/Source/WebDriver
Revision
252408
Author
carlo...@webkit.org
Date
2019-11-13 06:40:22 -0800 (Wed, 13 Nov 2019)

Log Message

WebDriver: duration can be undefined in pause actions
https://bugs.webkit.org/show_bug.cgi?id=204152

Reviewed by Carlos Alberto Lopez Perez.

Make duration optional in pause actions.

Fixes: imported/w3c/webdriver/tests/perform_actions/validity.py::test_pause_without_duration[none]
       imported/w3c/webdriver/tests/perform_actions/validity.py::test_pause_without_duration[key]
       imported/w3c/webdriver/tests/perform_actions/validity.py::test_pause_without_duration[pointer]

* Session.cpp:
(WebDriver::Session::performActions):
* WebDriverService.cpp:
(WebDriver::processPauseAction):

Modified Paths

Diff

Modified: trunk/Source/WebDriver/ChangeLog (252407 => 252408)


--- trunk/Source/WebDriver/ChangeLog	2019-11-13 14:38:06 UTC (rev 252407)
+++ trunk/Source/WebDriver/ChangeLog	2019-11-13 14:40:22 UTC (rev 252408)
@@ -1,5 +1,23 @@
 2019-11-13  Carlos Garcia Campos  <cgar...@igalia.com>
 
+        WebDriver: duration can be undefined in pause actions
+        https://bugs.webkit.org/show_bug.cgi?id=204152
+
+        Reviewed by Carlos Alberto Lopez Perez.
+
+        Make duration optional in pause actions.
+
+        Fixes: imported/w3c/webdriver/tests/perform_actions/validity.py::test_pause_without_duration[none]
+               imported/w3c/webdriver/tests/perform_actions/validity.py::test_pause_without_duration[key]
+               imported/w3c/webdriver/tests/perform_actions/validity.py::test_pause_without_duration[pointer]
+
+        * Session.cpp:
+        (WebDriver::Session::performActions):
+        * WebDriverService.cpp:
+        (WebDriver::processPauseAction):
+
+2019-11-13  Carlos Garcia Campos  <cgar...@igalia.com>
+
         WebDriver: check the frameID parameter before running switch to frame command
         https://bugs.webkit.org/show_bug.cgi?id=204150
 

Modified: trunk/Source/WebDriver/Session.cpp (252407 => 252408)


--- trunk/Source/WebDriver/Session.cpp	2019-11-13 14:38:06 UTC (rev 252407)
+++ trunk/Source/WebDriver/Session.cpp	2019-11-13 14:40:22 UTC (rev 252408)
@@ -2344,7 +2344,8 @@
                 state->setString("sourceId"_s, action.id);
                 switch (action.type) {
                 case Action::Type::None:
-                    state->setDouble("duration"_s, action.duration.value());
+                    if (action.duration)
+                        state->setDouble("duration"_s, action.duration.value());
                     break;
                 case Action::Type::Pointer: {
                     switch (action.subtype) {

Modified: trunk/Source/WebDriver/WebDriverService.cpp (252407 => 252408)


--- trunk/Source/WebDriver/WebDriverService.cpp	2019-11-13 14:38:06 UTC (rev 252407)
+++ trunk/Source/WebDriver/WebDriverService.cpp	2019-11-13 14:40:22 UTC (rev 252408)
@@ -1760,10 +1760,8 @@
 static bool processPauseAction(JSON::Object& actionItem, Action& action, Optional<String>& errorMessage)
 {
     RefPtr<JSON::Value> durationValue;
-    if (!actionItem.getValue("duration"_s, durationValue)) {
-        errorMessage = String("The parameter 'duration' is missing in pause action");
-        return false;
-    }
+    if (!actionItem.getValue("duration"_s, durationValue))
+        return true;
 
     auto duration = unsignedValue(*durationValue);
     if (!duration) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to