Skip to content

Commit

Permalink
Fix PageGotoTests' flakyness.
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardo-fernandes committed Jun 14, 2023
1 parent a5ae465 commit 6355f99
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/PuppeteerSharp/LifecycleWatcher.cs
Expand Up @@ -35,7 +35,6 @@ internal sealed class LifecycleWatcher : IDisposable
private IRequest _navigationRequest;
private bool _hasSameDocumentNavigation;
private bool _swapped;
private bool _newDocumentNavigation;

public LifecycleWatcher(
FrameManager frameManager,
Expand Down Expand Up @@ -99,7 +98,6 @@ private void Navigated(object sender, FrameEventArgs e)
return;
}

_newDocumentNavigation = true;
CheckLifecycleComplete();
}

Expand Down Expand Up @@ -143,7 +141,7 @@ private void CheckLifecycleComplete()
_sameDocumentNavigationTaskWrapper.TrySetResult(true);
}

if (_swapped || _newDocumentNavigation)
if (_swapped || _frame.LoaderId != _initialLoaderId)
{
_newDocumentNavigationTaskWrapper.TrySetResult(true);
}
Expand Down

0 comments on commit 6355f99

Please sign in to comment.