MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / waitForConnection

Method waitForConnection

javascript/selenium-webdriver/bidi/index.js:229–244  ·  view source on GitHub ↗

* Resolve connection * @returns {Promise }

()

Source from the content-addressed store, hash-verified

227 * @returns {Promise<unknown>}
228 */
229 async waitForConnection() {
230 return new Promise((resolve, reject) => {
231 if (this._closed) {
232 reject(new Error('BiDi connection is closed'))
233 return
234 }
235 if (this.connected) {
236 resolve()
237 return
238 }
239 // Park the waiter in a Set so the constructor's 'open' handler can
240 // resolve it and _failPending() can reject it. Avoids attaching socket
241 // listeners that close()'s removeAllListeners('close') would strip.
242 this._connectWaiters.add({ resolve, reject })
243 })
244 }
245
246 /**
247 * Sends a bidi request

Callers 3

sendMethod · 0.95
index_test.jsFile · 0.80

Calls 3

rejectFunction · 0.85
addMethod · 0.65
resolveFunction · 0.50

Tested by

no test coverage detected