зеркало из https://github.com/mozilla/gecko-dev.git
bug 1529282: mozrunner: support searching for Nightly’s default path on macOS. r=ato
This commit is contained in:
Родитель
e7fb372464
Коммит
1301ea21a7
|
@ -7,6 +7,22 @@ All notable changes to this program is documented in this file.
|
|||
Unreleased
|
||||
----------
|
||||
|
||||
### Added
|
||||
|
||||
- Added support for searching for Nightly’s default path on macOS
|
||||
|
||||
If the location of the Firefox binary is not given, geckodriver
|
||||
will from now also look for the location of Firefox Nightly in
|
||||
the default locations. The ordered list of search paths on macOS
|
||||
is as follows:
|
||||
|
||||
1. `/Applications/Firefox.app/Contents/MacOS/firefox-bin`
|
||||
2. `$HOME/Applications/Firefox.app/Contents/MacOS/firefox-bin`
|
||||
3. `/Applications/Firefox Nightly.app/Contents/MacOS/firefox-bin`
|
||||
4. `$HOME/Applications/Firefox Nightly.app/Contents/MacOS/firefox-bin`
|
||||
|
||||
Thanks to [Kriti Singh] for this patch.
|
||||
|
||||
### Removed
|
||||
|
||||
- Dropped support for legacy Selenium web element references
|
||||
|
@ -1194,6 +1210,7 @@ and greater.
|
|||
[Jeremy Lempereur]: https://github.com/o0Ignition0o
|
||||
[Joshua Bruning]: https://github.com/joshbruning
|
||||
[Kalpesh Krishna]: https://github.com/martiansideofthemoon
|
||||
[Kriti Singh]: https://github.com/kritisingh1
|
||||
[Mike Pennisi]: https://github.com/jugglinmike
|
||||
[Sven Jost]: https://github/mythsunwind
|
||||
[Vlad Filippov]: https://github.com/vladikoff
|
||||
|
|
|
@ -33,13 +33,16 @@ started and run. It may contain any of the following fields:
|
|||
to select which custom browser binary to use.
|
||||
If left undefined geckodriver will attempt
|
||||
to deduce the default location of Firefox
|
||||
on the current system.
|
||||
on the current system. If Firefox stable is
|
||||
not installed, it will suggest the default
|
||||
location of Firefox Nightly instead.
|
||||
|
||||
<p>
|
||||
On macOS the path must be absolute to the browser binary,
|
||||
e.g. <code>/Applications/Firefox.app/Contents/MacOS/firefox</code>.
|
||||
e.g. <code>/Applications/Firefox.app/Contents/MacOS/firefox</code> or,
|
||||
in case of Nightly, <code>/Applications/Firefox Nightly.app/Contents/MacOS/firefox</code>
|
||||
Specifying an application bundle such as <code>/Applications/Firefox.app</code>
|
||||
will <em>not</em> work.
|
||||
or <code>/Applications/Firefox Nightly.app</code> will <em>not</em> work.
|
||||
</tr>
|
||||
|
||||
<tr id=capability-args>
|
||||
|
|
|
@ -315,8 +315,9 @@ pub mod platform {
|
|||
use std::path::PathBuf;
|
||||
|
||||
/// Searches the system path for `firefox-bin`, then looks for
|
||||
/// `Applications/Firefox.app/Contents/MacOS/firefox-bin` under both `/`
|
||||
/// (system root) and the user home directory.
|
||||
/// `Applications/Firefox.app/Contents/MacOS/firefox-bin` as well
|
||||
/// as `Applications/Firefox Nightly.app/Contents/MacOS/firefox-bin`
|
||||
/// under both `/` (system root) and the user home directory.
|
||||
pub fn firefox_default_path() -> Option<PathBuf> {
|
||||
if let Some(path) = find_binary("firefox-bin") {
|
||||
return Some(path);
|
||||
|
@ -324,11 +325,10 @@ pub mod platform {
|
|||
|
||||
let home = dirs::home_dir();
|
||||
for &(prefix_home, trial_path) in [
|
||||
(
|
||||
false,
|
||||
"/Applications/Firefox.app/Contents/MacOS/firefox-bin",
|
||||
),
|
||||
(false, "/Applications/Firefox.app/Contents/MacOS/firefox-bin"),
|
||||
(true, "Applications/Firefox.app/Contents/MacOS/firefox-bin"),
|
||||
(false, "/Applications/Firefox Nightly.app/Contents/MacOS/firefox-bin"),
|
||||
(true, "Applications/Firefox Nightly.app/Contents/MacOS/firefox-bin"),
|
||||
].iter()
|
||||
{
|
||||
let path = match (home.as_ref(), prefix_home) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче