| 126 | } |
| 127 | |
| 128 | bool HtmlDialog::Wait(const std::string& page_load_strategy) { |
| 129 | LOG(TRACE) << "Entering HtmlDialog::Wait"; |
| 130 | // If the window is no longer valid, the window is closing, |
| 131 | // and the wait is completed. |
| 132 | if (!this->is_closing() && !this->IsValidWindow()) { |
| 133 | return true; |
| 134 | } |
| 135 | |
| 136 | // Check to see if a new dialog has opened up on top of this one. |
| 137 | // If so, the wait is completed, no matter whether the OnUnload |
| 138 | // event has fired signaling navigation started, nor whether the |
| 139 | // OnLoad event has fired signaling navigation complete. Set the |
| 140 | // flag so that the Wait method is no longer called. |
| 141 | HWND child_dialog_handle = this->GetActiveDialogWindowHandle(); |
| 142 | if (child_dialog_handle != NULL) { |
| 143 | this->is_navigating_ = false; |
| 144 | this->set_wait_required(false); |
| 145 | return true; |
| 146 | } |
| 147 | |
| 148 | // Otherwise, we wait a short amount and see if navigation is complete |
| 149 | // (signaled by the OnLoad event firing). |
| 150 | ::Sleep(250); |
| 151 | return !this->is_navigating_; |
| 152 | } |
| 153 | |
| 154 | HWND HtmlDialog::GetContentWindowHandle() { |
| 155 | LOG(TRACE) << "Entering HtmlDialog::GetContentWindowHandle"; |
nothing calls this directly
no test coverage detected