test: drop now-empty remote runner (#35343)

* test: drop the now-empty remote runner from CI

* move fixtures to spec-main

* remove remote runner

* fix stuff

* remove global-paths hack

* move ts-smoke to spec/

* fix test after merge

* rename spec-main to spec

* no need to ignore spec/node_modules twice

* simplify spec-runner a little

* no need to hash pj/yl twice

* undo lint change to verify-mksnapshot.py

* excessive ..

* update electron_woa_testing.yml

* don't search for test-results-remote.xml

it is never produced now
This commit is contained in:
Jeremy Rose
2022-08-16 12:23:13 -07:00
committed by GitHub
parent e87c4015fe
commit db7c92fd57
327 changed files with 950 additions and 1707 deletions

37
spec/pipe-transport.ts Normal file
View File

@@ -0,0 +1,37 @@
// A small pipe transport for talking to Electron over CDP.
export class PipeTransport {
private _pipeWrite: NodeJS.WritableStream | null;
private _pendingMessage = '';
onmessage?: (message: string) => void;
constructor (pipeWrite: NodeJS.WritableStream, pipeRead: NodeJS.ReadableStream) {
this._pipeWrite = pipeWrite;
pipeRead.on('data', buffer => this._dispatch(buffer));
}
send (message: Object) {
this._pipeWrite!.write(JSON.stringify(message));
this._pipeWrite!.write('\0');
}
_dispatch (buffer: Buffer) {
let end = buffer.indexOf('\0');
if (end === -1) {
this._pendingMessage += buffer.toString();
return;
}
const message = this._pendingMessage + buffer.toString(undefined, 0, end);
if (this.onmessage) { this.onmessage.call(null, JSON.parse(message)); }
let start = end + 1;
end = buffer.indexOf('\0', start);
while (end !== -1) {
const message = buffer.toString(undefined, start, end);
if (this.onmessage) { this.onmessage.call(null, JSON.parse(message)); }
start = end + 1;
end = buffer.indexOf('\0', start);
}
this._pendingMessage = buffer.toString(undefined, start);
}
}