Skip to content

Commit

Permalink
test: delay visibilityState check after hiding
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelmaddock committed Apr 21, 2021
1 parent 44bd280 commit ec9fe90
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spec-main/api-web-frame-main-spec.ts
Expand Up @@ -143,6 +143,11 @@ describe('webFrameMain module', () => {

expect(webFrame.visibilityState).to.equal('visible');
w.hide();

// Wait for visibility to propagate. If this ends up being flaky, we can
// look into binding WebContentsObserver::OnVisibilityChanged.
await new Promise(resolve => setTimeout(resolve, 10));

expect(webFrame.visibilityState).to.equal('hidden');
});
});
Expand Down

0 comments on commit ec9fe90

Please sign in to comment.