-
Notifications
You must be signed in to change notification settings - Fork 28
Add path query for chromium #62
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
base: master
Are you sure you want to change the base?
Conversation
Just figuring out the build failures 😢 |
Changing |
Oh, the |
On GNU/Linux anyway. Assume SunOS is the same
Provides more flexibility to find the PID
The chromium binary is actually a script that starts the /usr/lib/chromium binary with the correct arguments. We just need to search for the chromium instance that doesn't have a '--type' parameter
I've had more time to look into this and the var exec = require('child_process').exec;
exec('which chromium-browser chromium google-chrome google-chrome-stable || true'); If I run the following script in my node terminal I get: > null '/usr/bin/chromium\n' 'which: no chromium-browser in (/home/matt/.npm-global-packages/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/opt/opencascade/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:~/.posix_scripts)\nwhich: no google-chrome in (/home/matt/.npm-global-packages/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/opt/opencascade/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:~/.posix_scripts)\nwhich: no google-chrome-stable in (/home/matt/.npm-global-packages/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/opt/opencascade/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:~/.posix_scripts)\n' If I run the same code inside the null '' 'not found: chromium-browser\n' Will carry on investigating. |
When chrome fires up it requests for /favicon.ico automatically. As chrome can start up in a tab, it won't be killed and the request can occur during the start up of the next browser. This makes sure to only test the user agent when the request is for the root page.
This can provide more information in the mocha message
The difference between
[launchpad|chromium ↑·3|✚ 1] npm test
> [email protected] test /home/matt/git/github/ekryski/launchpad
> grunt test --stack
Running "jshint:lib" (jshint) task
>> 15 files lint free.
Running "jshint:test" (jshint) task
>> 2 files lint free.
Running "simplemocha:all" (simplemocha) task
Local browser launcher tests
Default env settings
[ '', 'not found: chromium-browser\n' ]
[ '/usr/bin/firefox\n', '' ]
✓ does local browser and version discovery (167ms)
✓ Launches chrome browser on linux
✓ Launches firefox browser on linux (586ms)
✓ Launches opera browser on linux
✓ Launches phantom browser on linux (140ms)
Custom env settings
✓ detects PhantomJS only due to env settings (120ms)
Remote Preview launcher
✓ Writes URL to file
7 passing (1s)
Done, without errors.
[launchpad|chromium ↑·3|✚ 1] ./node_modules/grunt-cli/bin/grunt
Running "jshint:lib" (jshint) task
>> 15 files lint free.
Running "jshint:test" (jshint) task
>> 2 files lint free.
Running "simplemocha:all" (simplemocha) task
Local browser launcher tests
Default env settings
[ '/usr/bin/firefox\n', '' ]
[ '/usr/bin/chromium\n',
'which: no chromium-browser in (/home/matt/.npm-global-packages/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/opt/opencascade/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:~/.posix_scripts)\nwhich: no google-chrome in (/home/matt/.npm-global-packages/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/opt/opencascade/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:~/.posix_scripts)\nwhich: no google-chrome-stable in (/home/matt/.npm-global-packages/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/opt/opencascade/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:~/.posix_scripts)\n' ]
✓ does local browser and version discovery (144ms)
✓ Launches chrome browser on linux (196ms)
✓ Launches firefox browser on linux (661ms)
✓ Launches opera browser on linux
✓ Launches phantom browser on linux (137ms)
Custom env settings
✓ detects PhantomJS only due to env settings (115ms)
Remote Preview launcher
✓ Writes URL to file
7 passing (1s)
Done, without errors. Just keeping this up-to-date with my findings in case I have to come back to this branch. |
Just hangs on Travis now. Will have to come back to this later. Works locally. |
Assumes that the use has
head
installed and that it supports the-n1
argument. This will strip the first found browser from the which command.Fixes #46