Bug 1254905: reduced default video size on Android to 320x240 @ 10 FPS. r=jesup
MozReview-Commit-ID: H440cYzCGhi
--- a/dom/media/tests/mochitest/head.js
+++ b/dom/media/tests/mochitest/head.js
@@ -263,34 +263,46 @@ var setTestOptions;
var testConfigured = new Promise(r => setTestOptions = r);
function setupEnvironment() {
if (!window.SimpleTest) {
// Running under Steeplechase
return;
}
- // Running as a Mochitest.
- SimpleTest.requestFlakyTimeout("WebRTC inherently depends on timeouts");
- window.finish = () => SimpleTest.finish();
- SpecialPowers.pushPrefEnv({
+ var defaultMochitestPrefs = {
'set': [
['media.peerconnection.enabled', true],
['media.peerconnection.identity.enabled', true],
['media.peerconnection.identity.timeout', 120000],
['media.peerconnection.ice.stun_client_maximum_transmits', 14],
['media.peerconnection.ice.trickle_grace_period', 30000],
['media.navigator.permission.disabled', true],
['media.navigator.streams.fake', FAKE_ENABLED],
['media.getusermedia.screensharing.enabled', true],
['media.getusermedia.screensharing.allowed_domains', "mochi.test"],
['media.getusermedia.audiocapture.enabled', true],
['media.recorder.audio_node.enabled', true]
]
- }, setTestOptions);
+ };
+
+ const isAndroid = !!navigator.userAgent.includes("Android");
+
+ if (isAndroid) {
+ defaultMochitestPrefs.set.push(
+ ["media.navigator.video.default_width", 320],
+ ["media.navigator.video.default_height", 240],
+ ["media.navigator.video.max_fr", 10]
+ );
+ }
+
+ // Running as a Mochitest.
+ SimpleTest.requestFlakyTimeout("WebRTC inherently depends on timeouts");
+ window.finish = () => SimpleTest.finish();
+ SpecialPowers.pushPrefEnv(defaultMochitestPrefs, setTestOptions);
// We don't care about waiting for this to complete, we just want to ensure
// that we don't build up a huge backlog of GC work.
SpecialPowers.exactGC(window);
}
// This is called by steeplechase; which provides the test configuration options
// directly to the test through this function. If we're not on steeplechase,