Skip to content

Commit 0c813da

Browse files
authored
chore: unship clock.uninstall (#37020)
1 parent 3680dc5 commit 0c813da

File tree

10 files changed

+0
-48
lines changed

10 files changed

+0
-48
lines changed

docs/src/api/class-clock.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,3 @@ Time to be set.
340340
- `time` <[string]|[Date]>
341341

342342
Time to be set.
343-
344-
## async method: Clock.uninstall
345-
* since: v1.55
346-
347-
Uninstall fake clock. Note that any currently open page will be still affected by the fake clock, until it navigates away to a new document.

packages/playwright-client/types/types.d.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18798,12 +18798,6 @@ export interface Clock {
1879818798
* @param time Time to be set in milliseconds.
1879918799
*/
1880018800
setSystemTime(time: number|string|Date): Promise<void>;
18801-
18802-
/**
18803-
* Uninstall fake clock. Note that any currently open page will be still affected by the fake clock, until it
18804-
* navigates away to a new document.
18805-
*/
18806-
uninstall(): Promise<void>;
1880718801
}
1880818802

1880918803
/**

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ export class Clock implements api.Clock {
5151
async setSystemTime(time: string | number | Date) {
5252
await this._browserContext._channel.clockSetSystemTime(parseTime(time));
5353
}
54-
55-
async uninstall() {
56-
await this._browserContext._channel.clockUninstall();
57-
}
5854
}
5955

6056
function parseTime(time: string | number | Date): { timeNumber?: number, timeString?: string } {

packages/playwright-core/src/protocol/validator.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,8 +1158,6 @@ scheme.BrowserContextClockSetSystemTimeParams = tObject({
11581158
timeString: tOptional(tString),
11591159
});
11601160
scheme.BrowserContextClockSetSystemTimeResult = tOptional(tObject({}));
1161-
scheme.BrowserContextClockUninstallParams = tOptional(tObject({}));
1162-
scheme.BrowserContextClockUninstallResult = tOptional(tObject({}));
11631161
scheme.PageInitializer = tObject({
11641162
mainFrame: tChannel(['Frame']),
11651163
viewportSize: tOptional(tObject({

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,10 +400,6 @@ export class BrowserContextDispatcher extends Dispatcher<BrowserContext, channel
400400
await this._context.clock.setSystemTime(progress, params.timeString ?? params.timeNumber ?? 0);
401401
}
402402

403-
async clockUninstall(params: channels.BrowserContextClockUninstallParams, progress: Progress): Promise<channels.BrowserContextClockUninstallResult> {
404-
await this._context.clock.uninstall(progress);
405-
}
406-
407403
async updateSubscription(params: channels.BrowserContextUpdateSubscriptionParams, progress: Progress): Promise<void> {
408404
if (params.enabled)
409405
this._subscriptions.add(params.event);

packages/playwright-core/src/utils/isomorphic/protocolMetainfo.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ export const methodMetainfo = new Map<string, { internal?: boolean, title?: stri
9797
['BrowserContext.clockRunFor', { title: 'Run clock "{ticksNumber|ticksString}"', }],
9898
['BrowserContext.clockSetFixedTime', { title: 'Set fixed time "{timeNumber|timeString}"', }],
9999
['BrowserContext.clockSetSystemTime', { title: 'Set system time "{timeNumber|timeString}"', }],
100-
['BrowserContext.clockUninstall', { title: 'Uninstall clock', }],
101100
['Page.addInitScript', { title: 'Add init script', group: 'configuration', }],
102101
['Page.close', { title: 'Close page', pausesBeforeAction: true, }],
103102
['Page.emulateMedia', { title: 'Emulate media', snapshot: true, pausesBeforeAction: true, }],

packages/playwright-core/types/types.d.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18798,12 +18798,6 @@ export interface Clock {
1879818798
* @param time Time to be set in milliseconds.
1879918799
*/
1880018800
setSystemTime(time: number|string|Date): Promise<void>;
18801-
18802-
/**
18803-
* Uninstall fake clock. Note that any currently open page will be still affected by the fake clock, until it
18804-
* navigates away to a new document.
18805-
*/
18806-
uninstall(): Promise<void>;
1880718801
}
1880818802

1880918803
/**

packages/protocol/src/channels.d.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,7 +1627,6 @@ export interface BrowserContextChannel extends BrowserContextEventTarget, EventT
16271627
clockRunFor(params: BrowserContextClockRunForParams, progress?: Progress): Promise<BrowserContextClockRunForResult>;
16281628
clockSetFixedTime(params: BrowserContextClockSetFixedTimeParams, progress?: Progress): Promise<BrowserContextClockSetFixedTimeResult>;
16291629
clockSetSystemTime(params: BrowserContextClockSetSystemTimeParams, progress?: Progress): Promise<BrowserContextClockSetSystemTimeResult>;
1630-
clockUninstall(params?: BrowserContextClockUninstallParams, progress?: Progress): Promise<BrowserContextClockUninstallResult>;
16311630
}
16321631
export type BrowserContextBindingCallEvent = {
16331632
binding: BindingCallChannel,
@@ -2006,9 +2005,6 @@ export type BrowserContextClockSetSystemTimeOptions = {
20062005
timeString?: string,
20072006
};
20082007
export type BrowserContextClockSetSystemTimeResult = void;
2009-
export type BrowserContextClockUninstallParams = {};
2010-
export type BrowserContextClockUninstallOptions = {};
2011-
export type BrowserContextClockUninstallResult = void;
20122008

20132009
export interface BrowserContextEvents {
20142010
'bindingCall': BrowserContextBindingCallEvent;

packages/protocol/src/protocol.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,9 +1470,6 @@ BrowserContext:
14701470
timeNumber: float?
14711471
timeString: string?
14721472

1473-
clockUninstall:
1474-
title: Uninstall clock
1475-
14761473
events:
14771474

14781475
bindingCall:

tests/library/page-clock.spec.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -565,16 +565,3 @@ it('correctly increments Date.now()/performance.now() during blocking execution'
565565
await page.goto(server.PREFIX + '/repro.html');
566566
await waitForDone;
567567
});
568-
569-
it('should uninstall', async ({ page }) => {
570-
await page.clock.install({ time: 0 });
571-
await page.clock.pauseAt(1000);
572-
expect(await page.evaluate(() => Date.now())).toBe(1000);
573-
574-
await page.goto('about:blank');
575-
expect(await page.evaluate(() => Date.now())).toBe(1000);
576-
577-
await page.clock.uninstall();
578-
await page.goto('about:blank');
579-
expect(await page.evaluate(() => Date.now())).not.toBe(1000);
580-
});

0 commit comments

Comments
 (0)