File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -537,5 +537,15 @@ public async Task RunForShouldNotRunNestedImmediateFromMicrotask()
537
537
Assert . AreEqual ( 2 , _calls . Count ) ;
538
538
Assert . AreEqual ( "inner" , _calls [ 1 ] [ 0 ] ) ;
539
539
}
540
+
541
+ [ PlaywrightTest ( "page-clock.spec.ts" , "" ) ]
542
+ public async Task ShouldHavePausedClockAfterInstall ( )
543
+ {
544
+ await Page . Clock . InstallAsync ( ) ;
545
+ await Page . GotoAsync ( "data:text/html," ) ;
546
+ var currentTime = await Page . EvaluateAsync < long > ( "Date.now()" ) ;
547
+ await Page . WaitForTimeoutAsync ( 100 ) ;
548
+ var newTime = await Page . EvaluateAsync < long > ( "Date.now()" ) ;
549
+ }
540
550
}
541
551
}
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ internal class Clock(BrowserContext browserContext) : IClock
32
32
{
33
33
public async Task InstallAsync ( ClockInstallOptions options = null )
34
34
{
35
+ options ??= new ( ) ;
35
36
Dictionary < string , object > args = null ;
36
37
if ( ( options . Time ?? options . TimeString ) != null )
37
38
{
You can’t perform that action at this time.
0 commit comments