Skip to content

Commit 0eeba38

Browse files
authored
chore: move crypto to server/util/ (#34759)
1 parent c2c336b commit 0eeba38

35 files changed

+104
-65
lines changed

packages/playwright-core/src/androidServerImpl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import { PlaywrightServer } from './remote/playwrightServer';
1818
import { createPlaywright } from './server/playwright';
19-
import { createGuid } from './utils';
19+
import { createGuid } from './server/utils/crypto';
2020
import { ws } from './utilsBundle';
2121

2222
import type { BrowserServer } from './client/browserType';

packages/playwright-core/src/browserServerImpl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { PlaywrightServer } from './remote/playwrightServer';
2020
import { helper } from './server/helper';
2121
import { serverSideCallMetadata } from './server/instrumentation';
2222
import { createPlaywright } from './server/playwright';
23-
import { createGuid } from './utils';
23+
import { createGuid } from './server/utils/crypto';
2424
import { rewriteErrorMessage } from './utils/stackTrace';
2525
import { ws } from './utilsBundle';
2626

packages/playwright-core/src/client/localUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export class LocalUtils extends ChannelOwner<channels.LocalUtilsChannel> {
5151
}
5252

5353
async harOpen(params: channels.LocalUtilsHarOpenParams): Promise<channels.LocalUtilsHarOpenResult> {
54-
return await localUtils.harOpen(this._harBackends, params);
54+
return await localUtils.harOpen(this._platform, this._harBackends, params);
5555
}
5656

5757
async harLookup(params: channels.LocalUtilsHarLookupParams): Promise<channels.LocalUtilsHarLookupResult> {

packages/playwright-core/src/client/waiter.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616

1717
import { TimeoutError } from './errors';
18-
import { createGuid } from '../utils/crypto';
1918
import { rewriteErrorMessage } from '../utils/stackTrace';
2019
import { zones } from '../utils/zones';
2120

@@ -35,7 +34,7 @@ export class Waiter {
3534
private _savedZone: Zone;
3635

3736
constructor(channelOwner: ChannelOwner<channels.EventTargetChannel>, event: string) {
38-
this._waitId = createGuid();
37+
this._waitId = channelOwner._platform.createGuid();
3938
this._channelOwner = channelOwner;
4039
this._savedZone = zones.current().without('apiZone');
4140

packages/playwright-core/src/server/android/android.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ import * as path from 'path';
2121

2222
import { TimeoutSettings } from '../../common/timeoutSettings';
2323
import { PipeTransport } from '../../utils/pipeTransport';
24-
import { createGuid, getPackageManagerExecCommand, isUnderTest, makeWaitForNextTask } from '../../utils';
24+
import { createGuid } from '../utils/crypto';
25+
import { isUnderTest } from '../../utils/debug';
26+
import { getPackageManagerExecCommand } from '../../utils/env';
27+
import { makeWaitForNextTask } from '../../utils/task';
2528
import { RecentLogsCollector } from '../../utils/debugLogger';
2629
import { debug } from '../../utilsBundle';
2730
import { wsReceiver, wsSender } from '../../utilsBundle';

packages/playwright-core/src/server/android/backendAdb.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
import { EventEmitter } from 'events';
1818
import * as net from 'net';
1919

20-
import { assert, createGuid } from '../../utils';
20+
import { assert } from '../../utils/debug';
21+
import { createGuid } from '../utils/crypto';
2122
import { debug } from '../../utilsBundle';
2223

2324
import type { Backend, DeviceBackend, SocketBackend } from './android';

packages/playwright-core/src/server/browserContext.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ import * as fs from 'fs';
1919
import * as path from 'path';
2020

2121
import { TimeoutSettings } from '../common/timeoutSettings';
22-
import { createGuid, debugMode } from '../utils';
22+
import { createGuid } from './utils/crypto';
23+
import { debugMode } from '../utils/debug';
2324
import { Clock } from './clock';
2425
import { Debugger } from './debugger';
2526
import { BrowserContextAPIRequestContext } from './fetch';

packages/playwright-core/src/server/chromium/crBrowser.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
import * as path from 'path';
1919

20-
import { assert, createGuid } from '../../utils';
20+
import { assert } from '../../utils/debug';
21+
import { createGuid } from '../utils/crypto';
2122
import { Artifact } from '../artifact';
2223
import { Browser } from '../browser';
2324
import { BrowserContext, assertBrowserContextIsNotOwned, verifyGeolocation } from '../browserContext';

packages/playwright-core/src/server/chromium/crPage.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
import * as path from 'path';
1919

20-
import { assert, createGuid } from '../../utils';
20+
import { assert } from '../../utils/debug';
21+
import { createGuid } from '../utils/crypto';
2122
import { eventsHelper } from '../../utils/eventsHelper';
2223
import { rewriteErrorMessage } from '../../utils/stackTrace';
2324
import * as dialog from '../dialog';

packages/playwright-core/src/server/dispatchers/browserContextDispatcher.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ import { Recorder } from '../recorder';
3131
import { TracingDispatcher } from './tracingDispatcher';
3232
import { WebSocketRouteDispatcher } from './webSocketRouteDispatcher';
3333
import { WritableStreamDispatcher } from './writableStreamDispatcher';
34-
import { createGuid, urlMatches } from '../../utils';
34+
import { createGuid } from '../utils/crypto';
35+
import { urlMatches } from '../../utils/isomorphic/urlMatch';
3536
import { RecorderApp } from '../recorder/recorderApp';
3637

3738
import type { Artifact } from '../artifact';

0 commit comments

Comments
 (0)