RESOLVED FIXED Bug 181473
WebDriver: deserializeTimeouts() shouldn't reject double timeout values
https://bugs.webkit.org/show_bug.cgi?id=181473
Summary WebDriver: deserializeTimeouts() shouldn't reject double timeout values
Zan Dobersek
Reported 2018-01-10 03:32:06 PST
WebDriver: deserializeTimeouts() shouldn't reject double timeout values
Attachments
Patch (1.74 KB, patch)
2018-01-10 04:25 PST, Zan Dobersek
no flags
Patch (2.70 KB, patch)
2018-01-10 06:58 PST, Zan Dobersek
no flags
Patch for landing (4.88 KB, patch)
2018-01-10 08:12 PST, Zan Dobersek
no flags
Zan Dobersek
Comment 1 2018-01-10 04:25:48 PST
Carlos Garcia Campos
Comment 2 2018-01-10 04:34:42 PST
8.5 Set Timeouts The steps to deserialize as a timeout with argument parameters are: 2.4. If value is not an integer, or it is less than 0 or greater than 264 – 1, return error with error code invalid argument.
Carlos Garcia Campos
Comment 3 2018-01-10 05:21:56 PST
Comment on attachment 330891 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=330891&action=review We should check that in case of being a double, it's an integer as the spec says. It's probably worht it adding a helper function isIntegerValue() since there are more integers mentioned in the spec > Source/WebDriver/WebDriverService.cpp:284 > - if (it->value->type() != JSON::Value::Type::Integer || !it->value->asInteger(timeoutMS) || timeoutMS < 0 || timeoutMS > INT_MAX) > + if (!it->value->asInteger(timeoutMS) || timeoutMS < 0 || timeoutMS > INT_MAX) I didn't know the spec also says: "An integer is a Number that is unchanged under the ToInteger operation." But this would allow any double which would break imported/w3c/webdriver/tests/sessions/new_session/invalid_capabilities.py::test_invalid_values
Zan Dobersek
Comment 4 2018-01-10 06:58:21 PST
Carlos Garcia Campos
Comment 5 2018-01-10 07:02:49 PST
Comment on attachment 330902 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=330902&action=review Excellent, thanks! > Source/WebDriver/ChangeLog:7 > + Please, mention here the tests fixed. > Source/WebDriver/WebDriverService.cpp:280 > + // value, i.e. if the double value was not originally in integer form. Add also a link to the spec https://w3c.github.io/webdriver/webdriver-spec.html#dfn-integer
Zan Dobersek
Comment 6 2018-01-10 08:12:16 PST
Created attachment 330907 [details] Patch for landing
Zan Dobersek
Comment 7 2018-01-10 08:16:24 PST
Comment on attachment 330907 [details] Patch for landing Clearing flags on attachment: 330907 Committed r226716: <https://trac.webkit.org/changeset/226716>
Zan Dobersek
Comment 8 2018-01-10 08:16:28 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 9 2018-01-10 08:17:17 PST
Note You need to log in before you can comment on or make changes to this bug.