Closed
Bug 826146
Opened 12 years ago
Closed 12 years ago
Need way to bypass app install prompt from test code
Categories
(Core Graveyard :: DOM: Apps, defect)
Core Graveyard
DOM: Apps
Tracking
(firefox19 wontfix, firefox20 fixed, b2g18 fixed)
RESOLVED
FIXED
mozilla20
People
(Reporter: bholley, Assigned: bholley)
Details
(Whiteboard: [qa-])
Attachments
(1 file)
2.66 KB,
patch
|
sicking
:
review+
sicking
:
approval-mozilla-b2g18+
|
Details | Diff | Splinter Review |
When running B2G mochitests, installing an app is impossible because there's nothing hooked up to listen for "webapps-ask-install" (normally handled by gaia). We should add a pref that can be frobbed via SpecialPowers.
Assignee | ||
Comment 1•12 years ago
|
||
CCing some people who might be interested in knowing that this is happening.
Assignee | ||
Comment 2•12 years ago
|
||
Attachment #697742 -
Flags: review?(jonas)
Comment on attachment 697742 [details] [diff] [review] Add a pref-controlled install confirmation override for automation. v1 Review of attachment 697742 [details] [diff] [review]: ----------------------------------------------------------------- We could also have the tests call pushPrefEnv directly. Totally up to you.
Attachment #697742 -
Flags: review?(jonas) → review+
Assignee | ||
Comment 4•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/1024e72d4ef9
Comment 5•12 years ago
|
||
Backed out because of test failures: https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=1024e72d4ef9 https://hg.mozilla.org/integration/mozilla-inbound/rev/e9cbccc2814c
Comment 6•12 years ago
|
||
Looks like this patch broke the existing mochitest chrome tests we have for webapps.
Comment 7•12 years ago
|
||
(In reply to comment #6) > Looks like this patch broke the existing mochitest chrome tests we have for > webapps. Yes, but it was backed out because of that. See comment 5.
Assignee | ||
Comment 8•12 years ago
|
||
Sigh, I forgot that get*Pref doesn't have sane defaults. Sicking - Would you prefer hasUserValue && getBoolPref, or a default value in b2g.js?
Flags: needinfo?(jonas)
I would say do hasUserValue && getBoolPref. That way the pref won't show up in about:config etc.
Flags: needinfo?(jonas)
Comment 10•12 years ago
|
||
Note that pushPrefEnv, as weird as it is, doesn't pop the pref at the end of the test. You have to do that yourself using popPrefEnv.
Assignee | ||
Comment 11•12 years ago
|
||
(In reply to Mounir Lamouri (:mounir) from comment #10) > Note that pushPrefEnv, as weird as it is, doesn't pop the pref at the end of > the test. You have to do that yourself using popPrefEnv. Uh, really? I'm pretty sure it does, via a call to flushPrefEnv in the test runner: http://mxr.mozilla.org/mozilla-central/source/testing/mochitest/tests/SimpleTest/TestRunner.js#453 That's half the point of the API. Indeed, the only calls to {push,flush}PrefEnv are in the test harness.
Assignee | ||
Comment 12•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/13c525135b4a
Comment 13•12 years ago
|
||
Erm, it would be better to add a method to the special powers API that registers a webapps-ask-install listener that auto-approves install requests. We used to have exactly such a pref, but we removed it, and I don't remember exactly why, but I think it was the result of a security review that flagged it as problematic, because it enables users to disable these prompts by setting a pref; and not just in B2G, but also on Android and desktop. cc:ing some security folks who might remember the context around that call.
Registering an observer that simply calls through wouldn't prevent the existing observer code from popping up the existing security UI, would it? I'm definitely interested if we can find better solutions though.
Comment 15•12 years ago
|
||
(In reply to Jonas Sicking (:sicking) from comment #14) > Registering an observer that simply calls through wouldn't prevent the > existing observer code from popping up the existing security UI, would it? It wouldn't, but doesn't comment 0 say there's nothing hooked up to observe the notification? If there is something hooked up to observe the notification, there are still other options. When we removed the pref, we modified the desktop mozApps mochitests to programmatically press the Install button in Firefox's Confirm Install doorhanger using SpecialPowers in the confirmNextInstall() function: http://hg.mozilla.org/mozilla-central/file/9ea498433661/dom/tests/mochitest/webapps/head.js#l47
Comment 16•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/13c525135b4a
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Updated•12 years ago
|
Whiteboard: [qa-]
Comment on attachment 697742 [details] [diff] [review] Add a pref-controlled install confirmation override for automation. v1 Review of attachment 697742 [details] [diff] [review]: ----------------------------------------------------------------- Approval for b2g18 since this is very low risk (simple and well tested at this point), and will help us write tests for the b2g code that we'll be shipping. I do agree that having a pref is not great, but it's not really a problem on b2g since we don't have about:config there. So uplifting to that branch doesn't seem like a problem.
Attachment #697742 -
Flags: approval-mozilla-b2g18+
But don't forget to uplift the followup fix of course.
Updated•7 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•