2020-08-28 10:51:55 -07:00
|
|
|
/**
|
|
|
|
* Copyright (c) Microsoft Corporation.
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2021-03-10 11:43:26 -08:00
|
|
|
import { CallMetadata } from '../../instrumentation';
|
2021-04-23 20:39:09 -07:00
|
|
|
import { FrameSnapshot, ResourceSnapshot } from '../../snapshot/snapshotTypes';
|
2021-05-13 22:36:34 -07:00
|
|
|
import { BrowserContextOptions } from '../../types';
|
2021-01-29 06:57:57 -08:00
|
|
|
|
2020-08-28 10:51:55 -07:00
|
|
|
export type ContextCreatedTraceEvent = {
|
2021-07-02 14:33:38 -07:00
|
|
|
version: number,
|
2021-05-13 22:36:34 -07:00
|
|
|
type: 'context-options',
|
2020-08-28 10:51:55 -07:00
|
|
|
browserName: string,
|
2021-05-13 22:36:34 -07:00
|
|
|
options: BrowserContextOptions
|
2020-09-11 11:34:53 -07:00
|
|
|
};
|
|
|
|
|
2021-04-08 05:32:12 +08:00
|
|
|
export type ScreencastFrameTraceEvent = {
|
2021-04-24 20:39:48 -07:00
|
|
|
type: 'screencast-frame',
|
2021-04-08 05:32:12 +08:00
|
|
|
pageId: string,
|
2021-04-08 22:59:05 +08:00
|
|
|
sha1: string,
|
|
|
|
width: number,
|
|
|
|
height: number,
|
2021-05-13 22:36:34 -07:00
|
|
|
timestamp: number,
|
2021-04-08 05:32:12 +08:00
|
|
|
};
|
|
|
|
|
2020-09-10 21:42:09 -07:00
|
|
|
export type ActionTraceEvent = {
|
2021-04-23 09:28:18 -07:00
|
|
|
type: 'action' | 'event',
|
2021-06-29 15:28:15 -07:00
|
|
|
hasSnapshot: boolean,
|
2021-03-10 11:43:26 -08:00
|
|
|
metadata: CallMetadata,
|
2020-08-28 10:51:55 -07:00
|
|
|
};
|
2020-09-18 11:54:00 -07:00
|
|
|
|
2021-04-23 20:39:09 -07:00
|
|
|
export type ResourceSnapshotTraceEvent = {
|
|
|
|
type: 'resource-snapshot',
|
|
|
|
snapshot: ResourceSnapshot,
|
|
|
|
};
|
|
|
|
|
|
|
|
export type FrameSnapshotTraceEvent = {
|
|
|
|
type: 'frame-snapshot',
|
|
|
|
snapshot: FrameSnapshot,
|
|
|
|
};
|
|
|
|
|
2021-08-03 16:08:06 -07:00
|
|
|
export type MarkerTraceEvent = {
|
|
|
|
type: 'marker',
|
|
|
|
resetIndex?: number,
|
|
|
|
};
|
|
|
|
|
2020-09-18 11:54:00 -07:00
|
|
|
export type TraceEvent =
|
|
|
|
ContextCreatedTraceEvent |
|
2021-04-08 05:32:12 +08:00
|
|
|
ScreencastFrameTraceEvent |
|
2021-01-15 18:30:55 -08:00
|
|
|
ActionTraceEvent |
|
2021-04-23 20:39:09 -07:00
|
|
|
ResourceSnapshotTraceEvent |
|
2021-08-03 16:08:06 -07:00
|
|
|
FrameSnapshotTraceEvent |
|
|
|
|
MarkerTraceEvent;
|