| 72 | } |
| 73 | |
| 74 | int Alert::Accept() { |
| 75 | LOG(TRACE) << "Entering Alert::Accept"; |
| 76 | DialogButtonInfo button_info = this->GetDialogButton(OK); |
| 77 | if (!button_info.button_exists) { |
| 78 | // No OK button on dialog. Look for a cancel button |
| 79 | // (JavaScript alert() dialogs have a single button, but its ID |
| 80 | // can be that of a "cancel" button.) |
| 81 | LOG(INFO) << "OK button does not exist on dialog; looking for Cancel button"; |
| 82 | button_info = this->GetDialogButton(CANCEL); |
| 83 | } |
| 84 | |
| 85 | if (!button_info.button_exists) { |
| 86 | LOG(WARN) << "OK and Cancel button do not exist on alert"; |
| 87 | return EUNHANDLEDERROR; |
| 88 | } |
| 89 | |
| 90 | LOG(DEBUG) << "Closing alert using SendMessage"; |
| 91 | int status_code = this->ClickAlertButton(button_info); |
| 92 | return WD_SUCCESS; |
| 93 | } |
| 94 | |
| 95 | int Alert::Dismiss() { |
| 96 | LOG(TRACE) << "Entering Alert::Dismiss"; |
no test coverage detected