src/vs/workbench/services/extensions/common/abstractExtensionService.ts/AbstractExtensionService/findTestExtensionHost
class AbstractExtensionService:	private findTestExtensionHost(testLocation: URI): ExtensionHostManager | undefined | null {
		let extensionHostKind: ExtensionHostKind | undefined;

		for (const extension of this._registry.getAllExtensionDescriptions()) {
			if (isEqualOrParent(testLocation, extension.extensionLocation)) {
				const runningLocation = this._runningLocation.get(ExtensionIdentifier.toKey(extension.identifier));
				if (runningLocation === ExtensionRunningLocation.LocalProcess) {
					extensionHostKind = ExtensionHostKind.LocalProcess;
				} else if (runningLocation === ExtensionRunningLocation.LocalWebWorker) {
					extensionHostKind = ExtensionHostKind.LocalWebWorker;
				} else if (runningLocation === ExtensionRunningLocation.Remote) {
					extensionHostKind = ExtensionHostKind.Remote;
				}
				break;
			}
		}
		if (extensionHostKind === undefined) {
			// not sure if we should support that, but it was possible to have an test outside an extension

			if (testLocation.scheme === Schemas.vscodeRemote) {
				extensionHostKind = ExtensionHostKind.Remote;
			} else {
				// When a debugger attaches to the extension host, it will surface all console.log messages from the extension host,
				// but not necessarily from the window. So it would be best if any errors get printed to the console of the extension host.
				// That is why here we use the local process extension host even for non-file URIs
				extensionHostKind = ExtensionHostKind.LocalProcess;
			}
		}
		if (extensionHostKind !== undefined) {
			return this._getExtensionHostManager(extensionHostKind);
		}
		return undefined;
	}