Convert web audio tests to PushPrefEnv

RESOLVED FIXED in mozilla24

Status

()

RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: rillian, Assigned: Ehsan)

Tracking

Trunk
mozilla24
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

According to Ted, SpecialPowers.setBoolPref() doesn't work on B2G, because preference setting is async there. Instead we must use pushPrefEnv(), which takes a callback to execute in the altered preference environment.

I worry that we've seen no problems with that because webaudio is enabled by default in nightly, and that ff24 will suddenly break B2G mochitests if/when we flip the pref.
Created attachment 765676 [details] [diff] [review]
Example fix

Here's an example of what the async test api looks like, borrowed from the WebVTT tests in bug 833386. If we like this I'm happy to do the mechanical conversion of the remaining tests.
Assignee: nobody → giles
Attachment #765676 - Flags: review?(ehsan)
Created attachment 765686 [details] [diff] [review]
Example fix

Oops. Set the correct pref!
Attachment #765676 - Attachment is obsolete: true
Attachment #765676 - Flags: review?(ehsan)
Attachment #765686 - Flags: review?(ehsan)
(Assignee)

Comment 3

6 years ago
Comment on attachment 765686 [details] [diff] [review]
Example fix

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

Hmm, shoot!  So let's take this patch for now, but please file a follow-up to fix this properly.  I think we should just add this pref to the mochitest profiles, and remove it from everywhere that we set/unset it manually.  There is no reason why we should ever disable Web Audio in mochitests.
Attachment #765686 - Flags: review?(ehsan) → review+
Pushed a pref flip to try to see how obvious this problem is.

https://tbpl.mozilla.org/?tree=Try&rev=cf697584c88b
Summary: Covert web audio tests to PushPrefEnv → Convert web audio tests to PushPrefEnv
(Assignee)

Comment 5

6 years ago
You changed browser/app/profile/firefox.js.  That's not going to affect b2g.
Good catch. Is b2g running the webaudio tests at all? I don't seem them in the mochitest logs from this push.

Presumedly firefox os uses b2g/app/b2g.js and so webaudio is already default-disabled there?
Pushed https://tbpl.mozilla.org/?tree=Try&rev=c0d551eddedb to at least verify the android side.
Attempt to enable webaudio tests on b2g with the pref disabled.
https://tbpl.mozilla.org/?tree=Try&rev=dcc5789ba017
11:08:03 INFO - 34561 ERROR TEST-UNEXPECTED-FAIL | /tests/content/media/webaudio/test/test_AudioBuffer.html | uncaught exception - ReferenceError: AudioContext is not defined at http://mochi.test:8888/tests/content/media/webaudio/test/test_AudioBuffer.html:16

So we do have an issue with setBoolPref.
(Assignee)

Updated

6 years ago
Blocks: 886168
(Assignee)

Comment 10

6 years ago
Created attachment 766492 [details] [diff] [review]
Patch (v1)

OK, this patch enables Web Audio on all mochitests, and makes us not need setBoolPref at all.
Assignee: giles → ehsan
Status: NEW → ASSIGNED
Attachment #766492 - Flags: review?(roc)
(Assignee)

Updated

6 years ago
Attachment #765686 - Attachment is obsolete: true
(Assignee)

Comment 11

6 years ago
https://hg.mozilla.org/mozilla-central/rev/aef71cf41cec
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
(Assignee)

Updated

6 years ago
Duplicate of this bug: 888183
You need to log in before you can comment on or make changes to this bug.