playwright-core 1.58.0-alpha-2025-12-03 → 1.58.0-alpha-2025-12-04

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,87 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var inMemorySnapshotter_exports = {};
20
- __export(inMemorySnapshotter_exports, {
21
- InMemorySnapshotter: () => InMemorySnapshotter
22
- });
23
- module.exports = __toCommonJS(inMemorySnapshotter_exports);
24
- var import_snapshotStorage = require("../../../utils/isomorphic/trace/snapshotStorage");
25
- var import_utils = require("../../../utils");
26
- var import_harTracer = require("../../har/harTracer");
27
- var import_snapshotter = require("../recorder/snapshotter");
28
- class InMemorySnapshotter {
29
- constructor(context) {
30
- this._blobs = /* @__PURE__ */ new Map();
31
- this._snapshotReadyPromises = /* @__PURE__ */ new Map();
32
- this._snapshotCount = 0;
33
- this._snapshotter = new import_snapshotter.Snapshotter(context, this);
34
- this._harTracer = new import_harTracer.HarTracer(context, null, this, { content: "attach", includeTraceInfo: true, recordRequestOverrides: false, waitForContentOnStop: false });
35
- this._storage = new import_snapshotStorage.SnapshotStorage();
36
- }
37
- async initialize() {
38
- await this._snapshotter.start();
39
- this._harTracer.start({ omitScripts: true });
40
- }
41
- async reset() {
42
- await this._snapshotter.reset();
43
- await this._harTracer.flush();
44
- this._harTracer.stop();
45
- this._harTracer.start({ omitScripts: true });
46
- }
47
- async dispose() {
48
- this._snapshotter.dispose();
49
- await this._harTracer.flush();
50
- this._harTracer.stop();
51
- }
52
- async captureSnapshot(page, callId, snapshotName) {
53
- if (this._snapshotReadyPromises.has(snapshotName))
54
- throw new Error("Duplicate snapshot name: " + snapshotName);
55
- this._snapshotter.captureSnapshot(page, callId, snapshotName).catch(() => {
56
- });
57
- const promise = new import_utils.ManualPromise();
58
- this._snapshotReadyPromises.set(snapshotName, promise);
59
- return promise;
60
- }
61
- onEntryStarted(entry) {
62
- }
63
- onEntryFinished(entry) {
64
- this._storage.addResource("", entry);
65
- }
66
- onContentBlob(sha1, buffer) {
67
- this._blobs.set(sha1, buffer);
68
- }
69
- onSnapshotterBlob(blob) {
70
- this._blobs.set(blob.sha1, blob.buffer);
71
- }
72
- onFrameSnapshot(snapshot) {
73
- ++this._snapshotCount;
74
- const renderer = this._storage.addFrameSnapshot("", snapshot, []);
75
- this._snapshotReadyPromises.get(snapshot.snapshotName || "")?.resolve(renderer);
76
- }
77
- async resourceContentForTest(sha1) {
78
- return this._blobs.get(sha1);
79
- }
80
- snapshotCount() {
81
- return this._snapshotCount;
82
- }
83
- }
84
- // Annotate the CommonJS export names for ESM import in node:
85
- 0 && (module.exports = {
86
- InMemorySnapshotter
87
- });