Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
257 changes: 252 additions & 5 deletions types/chrome-remote-interface/chrome-remote-interface-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,261 @@ function assertType<T>(value: T): T {
const cdpPort = { port: 9223 };
client = await CDP(cdpPort);
client.on("disconnect", () => {});
client.on("Network.requestWillBeSent", (params) => {
params.documentURL;
});
client.on("Debugger.resumed", () => {});
client.on("Network.requestWillBeSent.123", (params) => {});
client.on("event", (message) => {
if (message.method === "Network.requestWillBeSent") {}
});

// Stable Domains
{
client.on("Browser.downloadWillBegin", (params) => {
// $ExpectType DownloadWillBeginEvent
params;
});
client.on("Browser.downloadProgress", (params) => {
// $ExpectType DownloadProgressEvent
params;
});
client.on("Debugger.breakpointResolved", (params) => {
// $ExpectType BreakpointResolvedEvent
params;
});
client.on("Debugger.paused", (params) => {
// $ExpectType PausedEvent
params;
});
client.on("Debugger.scriptFailedToParse", (params) => {
// $ExpectType ScriptFailedToParseEvent
params;
});
client.on("Debugger.scriptParsed", (params) => {
// $ExpectType ScriptParsedEvent
params;
});
client.on("Debugger.resumed", () => {});
client.on("DOM.childNodeInserted", (params) => {
// $ExpectType ChildNodeInsertedEvent
params;
});
client.on("DOM.attributeRemoved", (params) => {
// $ExpectType AttributeRemovedEvent
params;
});
client.on("DOM.documentUpdated", () => {});
client.on("DOM.setChildNodes", (params) => {
// $ExpectType SetChildNodesEvent
params;
});
client.on("Emulation.virtualTimeBudgetExpired", () => {});
client.on("Fetch.requestPaused", (params) => {
// $ExpectType RequestPausedEvent
params;
});
client.on("Fetch.authRequired", (params) => {
// $ExpectType AuthRequiredEvent
params;
});
client.on("Input.dragIntercepted", (params) => {
// $ExpectType DragInterceptedEvent
params;
});
client.on("Log.entryAdded", (params) => {
// $ExpectType EntryAddedEvent
params;
});
client.on("Network.requestWillBeSent", (params) => {
// $ExpectType RequestWillBeSentEvent
params;
});
client.on("Network.loadingFailed", (params) => {
// $ExpectType LoadingFailedEvent
params;
});
client.on("Network.loadingFinished", (params) => {
// $ExpectType LoadingFinishedEvent
params;
});
client.on("Network.responseReceived", (params) => {
// $ExpectType ResponseReceivedEvent
params;
});
client.on("Page.domContentEventFired", (params) => {
// $ExpectType DomContentEventFiredEvent
params;
});
client.on("Page.frameNavigated", (params) => {
// $ExpectType FrameNavigatedEvent
params;
});
client.on("Page.loadEventFired", (params) => {
// $ExpectType LoadEventFiredEvent
params;
});
client.on("Performance.metrics", (params) => {
// $ExpectType MetricsEvent
params;
});
client.on("Profiler.consoleProfileFinished", (params) => {
// $ExpectType ConsoleProfileFinishedEvent
params;
});
client.on("Runtime.bindingCalled", (params) => {
// $ExpectType BindingCalledEvent
params;
});
client.on("Runtime.consoleAPICalled", (params) => {
// $ExpectType ConsoleAPICalledEvent
params;
});
client.on("Runtime.exceptionThrown", (params) => {
// $ExpectType ExceptionThrownEvent
params;
});
client.on("Runtime.executionContextCreated", (params) => {
// $ExpectType ExecutionContextCreatedEvent
params;
});
client.on("Runtime.executionContextDestroyed", (params) => {
// $ExpectType ExecutionContextDestroyedEvent
params;
});
client.on("Runtime.inspectRequested", (params) => {
// $ExpectType InspectRequestedEvent
params;
});
client.on("Security.certificateError", (params) => {
// $ExpectType CertificateErrorEvent
params;
});
client.on("Target.targetCreated", (params) => {
// $ExpectType TargetCreatedEvent
params;
});
}

// Deprecated domain events
client.on("Console.messageAdded", (params) => {
// $ExpectType MessageAddedEvent
params;
});

// Experimental domain events
{
client.on("Accessibility.loadComplete", (params) => {
// $ExpectType LoadCompleteEvent
params;
});
client.on("Accessibility.nodesUpdated", (params) => {
// $ExpectType NodesUpdatedEvent
params;
});
client.on("Animation.animationCreated", (params) => {
// $ExpectType AnimationCreatedEvent
params;
});
client.on("Audits.issueAdded", (params) => {
// $ExpectType IssueAddedEvent
params;
});
client.on("BackgroundService.recordingStateChanged", (params) => {
// $ExpectType RecordingStateChangedEvent
params;
});
client.on("BackgroundService.backgroundServiceEventReceived", (params) => {
// $ExpectType BackgroundServiceEventReceivedEvent
params;
});
client.on("Cast.sinksUpdated", (params) => {
// $ExpectType SinksUpdatedEvent
params;
});
client.on("Cast.issueUpdated", (params) => {
// $ExpectType IssueUpdatedEvent
params;
});
client.on("CSS.fontsUpdated", (params) => {
// $ExpectType FontsUpdatedEvent
params;
});
client.on("CSS.styleSheetAdded", (params) => {
// $ExpectType StyleSheetAddedEvent
params;
});
client.on("Database.addDatabase", (params) => {
// $ExpectType AddDatabaseEvent
params;
});
client.on("DeviceAccess.deviceRequestPrompted", (params) => {
// $ExpectType DeviceRequestPromptedEvent
params;
});
client.on("DOMStorage.domStorageItemAdded", (params) => {
// $ExpectType DomStorageItemAddedEvent
params;
});
client.on("FedCm.dialogShown", (params) => {
// $ExpectType DialogShownEvent
params;
});
client.on("HeapProfiler.heapStatsUpdate", (params) => {
// $ExpectType HeapStatsUpdateEvent
params;
});
client.on("Inspector.detached", (params) => {
// $ExpectType DetachedEvent
params;
});
client.on("Inspector.targetCrashed", () => {});
client.on("Inspector.targetReloadedAfterCrash", () => {});
client.on("LayerTree.layerTreeDidChange", (params) => {
// $ExpectType LayerTreeDidChangeEvent
params;
});
client.on("Media.playerPropertiesChanged", (params) => {
// $ExpectType PlayerPropertiesChangedEvent
params;
});
client.on("Overlay.inspectNodeRequested", (params) => {
// $ExpectType InspectNodeRequestedEvent
params;
});
client.on("Overlay.nodeHighlightRequested", (params) => {
// $ExpectType NodeHighlightRequestedEvent
params;
});
client.on("PerformanceTimeline.timelineEventAdded", (params) => {
// $ExpectType TimelineEventAddedEvent
params;
});
client.on("Preload.prerenderAttemptCompleted", (params) => {
// $ExpectType PrerenderAttemptCompletedEvent
params;
});
client.on("ServiceWorker.workerVersionUpdated", (params) => {
// $ExpectType WorkerVersionUpdatedEvent
params;
});
client.on("Storage.cacheStorageContentUpdated", (params) => {
// $ExpectType CacheStorageContentUpdatedEvent
params;
});
client.on("Tethering.accepted", (params) => {
// $ExpectType AcceptedEvent
params;
});
client.on("Tracing.dataCollected", (params) => {
// $ExpectType DataCollectedEvent
params;
});
client.on("WebAudio.contextCreated", (params) => {
// $ExpectType ContextCreatedEvent
params;
});
client.on("WebAuthn.credentialAdded", (params) => {
// $ExpectType CredentialAddedEvent
params;
});
}

const { Network, Page, Runtime } = client;
await Network.enable();
await Network.enable({});
Expand Down
Loading