Commit c469ea65 authored by Tricia Crichton's avatar Tricia Crichton Committed by Commit Bot

[ChromeDriver] Add alert text to UnexpectedAlert status

Add the text of the open alert when returning UnexpectedAlertOpen.

Bug: chromedriver:3184
Change-Id: Ifcd0e59c0d5d32089fca20b01b6f626ea5b4e741
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1898385Reviewed-by: default avatarJohn Chen <johnchen@chromium.org>
Commit-Queue: Tricia Crichton <triciac@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712617}
parent 5ec9b310
...@@ -1113,8 +1113,13 @@ Status WebViewImpl::IsNotPendingNavigation(const std::string& frame_id, ...@@ -1113,8 +1113,13 @@ Status WebViewImpl::IsNotPendingNavigation(const std::string& frame_id,
if (status.IsError()) if (status.IsError())
return status; return status;
// An alert may block the pending navigation. // An alert may block the pending navigation.
if (dialog_manager_->IsDialogOpen()) if (dialog_manager_->IsDialogOpen()) {
std::string alert_text;
status = dialog_manager_->GetDialogMessage(&alert_text);
if (status.IsError())
return Status(kUnexpectedAlertOpen); return Status(kUnexpectedAlertOpen);
return Status(kUnexpectedAlertOpen, "{Alert text : " + alert_text + "}");
}
*is_not_pending = !is_pending; *is_not_pending = !is_pending;
return Status(kOk); return Status(kOk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment