2020-08-28 20:51:55 +03: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.
|
|
|
|
*/
|
|
|
|
|
2022-09-21 04:41:51 +03:00
|
|
|
import type { CallMetadata } from '@protocol/callMetadata';
|
|
|
|
import type { FrameSnapshot, ResourceSnapshot } from './snapshot';
|
|
|
|
|
|
|
|
export type Size = { width: number, height: number };
|
2021-10-13 00:42:50 +03:00
|
|
|
|
2022-03-26 00:12:00 +03:00
|
|
|
// Make sure you add _modernize_N_to_N1(event: any) to traceModel.ts.
|
2022-09-21 04:41:51 +03:00
|
|
|
export type VERSION = 3;
|
2021-10-13 00:42:50 +03:00
|
|
|
|
|
|
|
export type BrowserContextEventOptions = {
|
|
|
|
viewport?: Size,
|
|
|
|
deviceScaleFactor?: number,
|
|
|
|
isMobile?: boolean,
|
2021-11-10 09:13:51 +03:00
|
|
|
userAgent?: string,
|
2021-10-13 00:42:50 +03:00
|
|
|
};
|
2021-01-29 17:57:57 +03:00
|
|
|
|
2020-08-28 20:51:55 +03:00
|
|
|
export type ContextCreatedTraceEvent = {
|
2021-07-03 00:33:38 +03:00
|
|
|
version: number,
|
2021-05-14 08:36:34 +03:00
|
|
|
type: 'context-options',
|
2020-08-28 20:51:55 +03:00
|
|
|
browserName: string,
|
2021-11-10 09:13:51 +03:00
|
|
|
platform: string,
|
|
|
|
wallTime: number,
|
2021-11-02 07:23:35 +03:00
|
|
|
title?: string,
|
2021-10-13 00:42:50 +03:00
|
|
|
options: BrowserContextEventOptions
|
2020-09-11 21:34:53 +03:00
|
|
|
};
|
|
|
|
|
2021-04-08 00:32:12 +03:00
|
|
|
export type ScreencastFrameTraceEvent = {
|
2021-04-25 06:39:48 +03:00
|
|
|
type: 'screencast-frame',
|
2021-04-08 00:32:12 +03:00
|
|
|
pageId: string,
|
2021-04-08 17:59:05 +03:00
|
|
|
sha1: string,
|
|
|
|
width: number,
|
|
|
|
height: number,
|
2021-05-14 08:36:34 +03:00
|
|
|
timestamp: number,
|
2021-04-08 00:32:12 +03:00
|
|
|
};
|
|
|
|
|
2020-09-11 07:42:09 +03:00
|
|
|
export type ActionTraceEvent = {
|
2021-04-23 19:28:18 +03:00
|
|
|
type: 'action' | 'event',
|
2021-03-10 22:43:26 +03:00
|
|
|
metadata: CallMetadata,
|
2020-08-28 20:51:55 +03:00
|
|
|
};
|
2020-09-18 21:54:00 +03:00
|
|
|
|
2021-04-24 06:39:09 +03:00
|
|
|
export type ResourceSnapshotTraceEvent = {
|
|
|
|
type: 'resource-snapshot',
|
|
|
|
snapshot: ResourceSnapshot,
|
|
|
|
};
|
|
|
|
|
|
|
|
export type FrameSnapshotTraceEvent = {
|
|
|
|
type: 'frame-snapshot',
|
|
|
|
snapshot: FrameSnapshot,
|
|
|
|
};
|
|
|
|
|
2020-09-18 21:54:00 +03:00
|
|
|
export type TraceEvent =
|
|
|
|
ContextCreatedTraceEvent |
|
2021-04-08 00:32:12 +03:00
|
|
|
ScreencastFrameTraceEvent |
|
2021-01-16 05:30:55 +03:00
|
|
|
ActionTraceEvent |
|
2021-04-24 06:39:09 +03:00
|
|
|
ResourceSnapshotTraceEvent |
|
2021-08-24 02:08:09 +03:00
|
|
|
FrameSnapshotTraceEvent;
|