summaryrefslogtreecommitdiffstats
path: root/ipc/glue/test/browser/browser_utility_multipleAudio.js
blob: 107cd2e234a12be6cc1a5ac10b9363c0d7657434 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

/* import-globals-from head-multiple.js */

Services.scriptloader.loadSubScript(
  "chrome://mochitests/content/browser/ipc/glue/test/browser/head-multiple.js",
  this
);

add_setup(async function checkAudioDecodingNonUtility() {
  const isAudioDecodingNonUtilityAllowed = await SpecialPowers.getBoolPref(
    "media.allow-audio-non-utility"
  );
  ok(
    !isAudioDecodingNonUtilityAllowed,
    "Audio decoding should not be allowed on non utility processes by default"
  );
});

add_task(async function testAudioDecodingInUtility() {
  await runTest({ expectUtility: true });
});

add_task(async function testFailureAudioDecodingInRDD() {
  await runTest({ expectUtility: false, expectError: true });
});

add_task(async function testFailureAudioDecodingInContent() {
  const platform = Services.appinfo.OS;
  if (platform === "WINNT") {
    ok(
      true,
      "Manually skipping on Windows because of gfx killing us, cf browser.ini"
    );
    return;
  }

  await SpecialPowers.pushPrefEnv({
    set: [["media.rdd-process.enabled", false]],
  });
  await runTest({ expectUtility: false, expectRDD: false, expectError: true });
});