Closed Bug 916512 Opened 11 years ago Closed 11 years ago

[mozrunner] mozrunner should use -foreground at least for mac

Categories

(Testing :: Mozbase, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: k0scist, Assigned: k0scist)

Details

Attachments

(1 file)

Attached patch bug-916512.diffSplinter Review
Assignee: nobody → jhammel
Attachment #805253 - Flags: review?(ahalberstadt)
Comment on attachment 805253 [details] [diff] [review]
bug-916512.diff

Review of attachment 805253 [details] [diff] [review]:
-----------------------------------------------------------------

::: mozrunner/mozrunner/local.py
@@ +110,2 @@
>              self.cmdargs = _cmdargs
>              self.cmdargs.append('-foreground')

So what's with that line? Is it still necessary?
Comment on attachment 805253 [details] [diff] [review]
bug-916512.diff

Review of attachment 805253 [details] [diff] [review]:
-----------------------------------------------------------------

::: mozrunner/mozrunner/local.py
@@ +110,3 @@
>              self.cmdargs = _cmdargs
>              self.cmdargs.append('-foreground')
> +        if mozinfo.isMac and '-foreground' not in self.cmdargs:

Could just make this 'elif mozinfo.isMac' and drop the '-foreground' clause, though either way works :)
Attachment #805253 - Flags: review?(ahalberstadt) → review+
pushed: https://github.com/mozilla/mozbase/commit/630fccd22472495c9ccca256ac1517601753f5b1 

I elected to keep the added logic separate from the preceding indented block since I'm not sure the status of bug 625614 (outside of outstanding) and the added logic, AFAIK, can be kept even if bug 625614 is resolved.  In my opinion the extra line of code is worth it, though I also don't care that much.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
This has caused the Gaia UI tests on b2gdesktop to steal focus for every test, which is rather annoying when running them locally. Is there a way we can make this optional? It's not a requirement for these tests as we use focusmanager.testmode where focus is required.
Flags: needinfo?(jhammel)
(In reply to Dave Hunt (:davehunt) from comment #5)
> This has caused the Gaia UI tests on b2gdesktop to steal focus for every
> test, which is rather annoying when running them locally. Is there a way we
> can make this optional? It's not a requirement for these tests as we use
> focusmanager.testmode where focus is required.

AFAIK, the -foreground is for mac only.  I assume you are on a Mac?  I'd be fine with a subclass that didn't have this behaviour.
Flags: needinfo?(jhammel)
Yes, I'm using Mac. Do you know why we need to run with -foreground on Mac? Would enabling the focusmanager.testmode preference be a suitable alternative? If we're to add a new subclass, could you suggest an approach... perhaps a LocalBackgroundRunner that sets a flag to force running in the background?
Flags: needinfo?(jhammel)
If you don't run with -foreground on Mac the app doesn't start in the foreground. With focusmanager.testmode I'm not sure this is important for tests anymore.
(In reply to Dave Hunt (:davehunt) from comment #7)
> Yes, I'm using Mac. Do you know why we need to run with -foreground on Mac?
> Would enabling the focusmanager.testmode preference be a suitable
> alternative? If we're to add a new subclass, could you suggest an
> approach... perhaps a LocalBackgroundRunner that sets a flag to force
> running in the background?

Pretty much Ted said. For a subclass, say LocalBackgroundRunner, I'd A. break out the '-foreground' appending logic to its own, say, function (def set_arguments()) and B. have the subclass not do anything with the method.

I'm also fine discarding this logic if unneeded, but IIRC there were problems when I quite accidentally did so.
Flags: needinfo?(jhammel)
"me too" on the focus issues in comment 5.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: