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!
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
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.
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)
Attachment #766492 - Flags: review?(roc) → review+
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.