MCPcopy Index your code
hub / github.com/SeleniumHQ/selenium / waitForConnection

Method waitForConnection

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

* Resolve connection * @returns {Promise }

()

Source from the content-addressed store, hash-verified

179 * @returns {Promise<unknown>}
180 */
181 async waitForConnection() {
182 return new Promise((resolve, reject) => {
183 if (this._closed) {
184 reject(new Error('BiDi connection is closed'))
185 return
186 }
187 if (this.connected) {
188 resolve()
189 return
190 }
191 // Park the waiter in a Set so the constructor's 'open' handler can
192 // resolve it and _failPending() can reject it. Avoids attaching socket
193 // listeners that close()'s removeAllListeners('close') would strip.
194 this._connectWaiters.add({ resolve, reject })
195 })
196 }
197
198 /**
199 * Sends a bidi request

Callers 2

sendMethod · 0.95
index_test.jsFile · 0.80

Calls 3

addMethod · 0.65
rejectFunction · 0.50
resolveFunction · 0.50

Tested by

no test coverage detected