Title: [222703] trunk/Source/WebDriver
Revision
222703
Author
[email protected]
Date
2017-10-02 02:09:07 -0700 (Mon, 02 Oct 2017)

Log Message

WebDriver: HTTP status code is not correct for some of the errors
https://bugs.webkit.org/show_bug.cgi?id=177354

Reviewed by Brian Burg.

I think this changed in the spec at some point. The thing is that no such alert, frame and window and stale
element reference errors should return 404 instead of 400.

https://w3c.github.io/webdriver/webdriver-spec.html#handling-errors

* CommandResult.cpp:
(WebDriver::CommandResult::httpStatusCode const):

Modified Paths

Diff

Modified: trunk/Source/WebDriver/ChangeLog (222702 => 222703)


--- trunk/Source/WebDriver/ChangeLog	2017-10-02 08:55:11 UTC (rev 222702)
+++ trunk/Source/WebDriver/ChangeLog	2017-10-02 09:09:07 UTC (rev 222703)
@@ -1,3 +1,18 @@
+2017-10-02  Carlos Garcia Campos  <[email protected]>
+
+        WebDriver: HTTP status code is not correct for some of the errors
+        https://bugs.webkit.org/show_bug.cgi?id=177354
+
+        Reviewed by Brian Burg.
+
+        I think this changed in the spec at some point. The thing is that no such alert, frame and window and stale
+        element reference errors should return 404 instead of 400.
+
+        https://w3c.github.io/webdriver/webdriver-spec.html#handling-errors
+
+        * CommandResult.cpp:
+        (WebDriver::CommandResult::httpStatusCode const):
+
 2017-09-19  Carlos Garcia Campos  <[email protected]>
 
         WebDriver: Implement commands to get and set the window rect

Modified: trunk/Source/WebDriver/CommandResult.cpp (222702 => 222703)


--- trunk/Source/WebDriver/CommandResult.cpp	2017-10-02 08:55:11 UTC (rev 222702)
+++ trunk/Source/WebDriver/CommandResult.cpp	2017-10-02 09:09:07 UTC (rev 222703)
@@ -136,13 +136,13 @@
     case ErrorCode::InvalidArgument:
     case ErrorCode::InvalidElementState:
     case ErrorCode::InvalidSelector:
+        return 400;
     case ErrorCode::NoSuchAlert:
+    case ErrorCode::NoSuchCookie:
+    case ErrorCode::NoSuchElement:
     case ErrorCode::NoSuchFrame:
     case ErrorCode::NoSuchWindow:
     case ErrorCode::StaleElementReference:
-        return 400;
-    case ErrorCode::NoSuchCookie:
-    case ErrorCode::NoSuchElement:
     case ErrorCode::InvalidSessionID:
     case ErrorCode::UnknownCommand:
         return 404;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to