Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: expose public interface for locating Chrome installations #177

Conversation

knksmith57
Copy link
Contributor

Add Launcher.getInstallations() public static method that returns an
array of paths to available Chrome binaries. Also, refactor
Launcher#launch() to use it.

Launcher.getInstallations() uses chrome-finder under the hood, so all
previous resolution logic is preserved:

  • if CHROME_PATH env variable is set, it will be included
  • if a Chrome Canary is detected, it will be included
  • if a Chrome (stable) is detected, it will be included

Resolves #176

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@knksmith57
Copy link
Contributor Author

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@knksmith57 knksmith57 force-pushed the expose-chrome-finder-public-interface branch from 36cca01 to 2be0045 Compare October 25, 2019 20:54
src/chrome-launcher.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

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

LGTM % nits

thanks @knksmith57!

src/chrome-launcher.ts Outdated Show resolved Hide resolved
test/chrome-launcher-test.ts Show resolved Hide resolved
Add Launcher.getInstallations() public static method that returns an
array of paths to available Chrome binaries. Also, refactor
Launcher#launch() to use it.

Launcher.getInstallations() uses chrome-finder under the hood, so all
previous resolution logic is preserved:
- if CHROME_PATH env variable is set, it will be included
- if a Chrome Canary is detected, it will be included
- if a Chrome (stable) is detected, it will be included

Resolves GoogleChrome#176
@knksmith57 knksmith57 force-pushed the expose-chrome-finder-public-interface branch from fb74c30 to 71e46d3 Compare October 25, 2019 21:19
@knksmith57
Copy link
Contributor Author

knksmith57 commented Oct 25, 2019

OK looks like adding that additional assert worked (I didn't realize we codified the chrome dep in the travis config; I should have looked at that first 😅).

I think I've addressed all feedback --thanks again for the super fast review!

@patrickhulce
Copy link
Collaborator

yup the rest of our tests would fail if we didn't have chrome available so it's a safe bet :)

@patrickhulce
Copy link
Collaborator

looks great, thanks again @knksmith57! 🎉 💯

@patrickhulce patrickhulce merged commit c4890ee into GoogleChrome:master Oct 25, 2019
@paulirish
Copy link
Member

great idea :D

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.

request: expose public interface for locating chrome path
4 participants