Skip to content

Conversation

JoelEinbinder
Copy link
Contributor

I had a test, but it was chromium only (reading the cookies file). I'll work on a better one.

}

async close() {
if (this._closeOverride)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Pavel suggested you could use this.__server__.close() if server is set instead of passing the callback. *Broser.close() implementation would be a bit more obvious then.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can make it this._server to make it more legit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done as _ownedServer

gracefullyClosing = true;
debugBrowser(`<gracefully close start>`);
options.attemptToGracefullyClose().catch(() => killProcess());
await options.attemptToGracefullyClose().catch(() => killProcess());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if killProcess throws, the error will appear in the right place, among other subtle changes. I always prefer to await promises.

@JoelEinbinder JoelEinbinder merged commit 3d6d9db into microsoft:master Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants