| 1578 | } |
| 1579 | |
| 1580 | int IECommandExecutor::CreateNewBrowser(std::string* error_message) { |
| 1581 | LOG(TRACE) << "Entering IECommandExecutor::CreateNewBrowser"; |
| 1582 | |
| 1583 | DWORD process_id = this->factory_->LaunchBrowserProcess(error_message); |
| 1584 | if (process_id == NULL) { |
| 1585 | LOG(WARN) << "Unable to launch browser, received NULL process ID"; |
| 1586 | this->is_waiting_ = false; |
| 1587 | return ENOSUCHDRIVER; |
| 1588 | } |
| 1589 | |
| 1590 | ProcessWindowInfo process_window_info; |
| 1591 | process_window_info.dwProcessId = process_id; |
| 1592 | process_window_info.hwndBrowser = NULL; |
| 1593 | process_window_info.pBrowser = NULL; |
| 1594 | bool attached = this->factory_->AttachToBrowser(&process_window_info, |
| 1595 | error_message); |
| 1596 | if (!attached) { |
| 1597 | LOG(WARN) << "Unable to attach to browser COM object"; |
| 1598 | this->is_waiting_ = false; |
| 1599 | return ENOSUCHDRIVER; |
| 1600 | } |
| 1601 | |
| 1602 | // Set persistent hover functionality in the interactions implementation. |
| 1603 | //this->input_manager_->StartPersistentEvents(); |
| 1604 | LOG(INFO) << "Persistent hovering set to: " |
| 1605 | << this->input_manager_->use_persistent_hover(); |
| 1606 | |
| 1607 | this->proxy_manager_->SetProxySettings(process_window_info.hwndBrowser); |
| 1608 | BrowserHandle wrapper(new Browser(process_window_info.pBrowser, |
| 1609 | process_window_info.hwndBrowser, |
| 1610 | this->m_hWnd, |
| 1611 | this->is_edge_chromium_)); |
| 1612 | |
| 1613 | this->AddManagedBrowser(wrapper); |
| 1614 | bool is_busy = wrapper->IsBusy(); |
| 1615 | if (is_busy) { |
| 1616 | LOG(WARN) << "Browser was launched and attached to, but is still busy."; |
| 1617 | } |
| 1618 | wrapper->SetFocusToBrowser(); |
| 1619 | this->edge_temp_dir_ = this->factory_->GetEdgeTempDir(); |
| 1620 | return WD_SUCCESS; |
| 1621 | } |
| 1622 | |
| 1623 | int IECommandExecutor::GetManagedElement(const std::string& element_id, |
| 1624 | ElementHandle* element_wrapper) const { |
no test coverage detected