WebDriver: evaluating javascript shouldn't fail if a dialog is shown
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Apr 2019 20:46:55 +0000 (20:46 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Apr 2019 20:46:55 +0000 (20:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196847
<rdar://problem/49609396>

Reviewed by Brian Burg.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::willShowJavaScriptDialog):

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

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp

index 2214d18..f2d36c5 100644 (file)
@@ -1,3 +1,14 @@
+2019-04-12  Devin Rousso  <drousso@apple.com>
+
+        WebDriver: evaluating javascript shouldn't fail if a dialog is shown
+        https://bugs.webkit.org/show_bug.cgi?id=196847
+        <rdar://problem/49609396>
+
+        Reviewed by Brian Burg.
+
+        * UIProcess/Automation/WebAutomationSession.cpp:
+        (WebKit::WebAutomationSession::willShowJavaScriptDialog):
+
 2019-04-12  Ross Kirsling  <ross.kirsling@sony.com>
 
         WebKit should build successfully even with -DENABLE_UNIFIED_BUILDS=OFF
index 59421fd..b95a65f 100644 (file)
@@ -652,10 +652,9 @@ void WebAutomationSession::willShowJavaScriptDialog(WebPageProxy& page)
         }
 
         if (!m_evaluateJavaScriptFunctionCallbacks.isEmpty()) {
-            Inspector::ErrorString unexpectedAlertOpenError = STRING_FOR_PREDEFINED_ERROR_NAME(UnexpectedAlertOpen);
             for (auto key : copyToVector(m_evaluateJavaScriptFunctionCallbacks.keys())) {
                 auto callback = m_evaluateJavaScriptFunctionCallbacks.take(key);
-                callback->sendFailure(unexpectedAlertOpenError);
+                callback->sendSuccess(emptyString());
             }
         }