MCPcopy
hub / github.com/microsoft/playwright / AndroidSocket

Class AndroidSocket

packages/playwright-core/src/client/android.ts:287–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285}
286
287export class AndroidSocket extends ChannelOwner<channels.AndroidSocketChannel> implements api.AndroidSocket {
288 static from(androidDevice: channels.AndroidSocketChannel): AndroidSocket {
289 return (androidDevice as any)._object;
290 }
291
292 constructor(parent: ChannelOwner, type: string, guid: string, initializer: channels.AndroidSocketInitializer) {
293 super(parent, type, guid, initializer);
294 this._channel.on('data', ({ data }) => this.emit(Events.AndroidSocket.Data, data));
295 this._channel.on('close', () => this.emit(Events.AndroidSocket.Close));
296 }
297
298 async write(data: Buffer): Promise<void> {
299 await this._channel.write({ data });
300 }
301
302 async close(): Promise<void> {
303 await this._channel.close();
304 }
305
306 async [Symbol.asyncDispose]() {
307 await this.close();
308 }
309}
310
311async function loadFile(platform: Platform, file: string | Buffer): Promise<Buffer> {
312 if (isString(file))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…