Commit d48e1217 authored by Marina Ciocea's avatar Marina Ciocea Committed by Commit Bot

Remove sandboxing from audio out of process flags in browsertests.

Sandboxing flag should be enabled through field trial config instead:
https://cs.chromium.org/chromium/src/testing/variations/fieldtrial_testing_config.json

Change-Id: Ic34d3b1b5b52275bbee644e2a763cc50fed127da
Reviewed-on: https://chromium-review.googlesource.com/1209546Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Commit-Queue: Marina Ciocea <marinaciocea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589163}
parent 17e80a42
......@@ -18,73 +18,25 @@
#include "media/base/media_switches.h"
#include "media/webrtc/webrtc_switches.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "services/service_manager/sandbox/features.h"
#include "testing/gtest/include/gtest/gtest-param-test.h"
namespace content {
namespace {
// Temporary enum, used for running the tests with different combination of
// flags while audio service is under experiment.
// TODO(https://crbug.com/850878) Remove after enabling sandboxing on all
// platforms.
enum class AudioServiceFeatures {
kDisabled,
kOutOfProcess,
#if defined(OS_WIN)
kSandboxed,
#endif
#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
kSandboxedWithAudioServiceAPM
#endif
};
} // namespace
// This class tests the scenario when permission to access mic or camera is
// granted.
class WebRtcAudioBrowserTest
: public WebRtcContentBrowserTestBase,
public testing::WithParamInterface<AudioServiceFeatures> {
class WebRtcAudioBrowserTest : public WebRtcContentBrowserTestBase,
public testing::WithParamInterface<bool> {
public:
WebRtcAudioBrowserTest() {
std::vector<base::Feature> audio_service_oop_features = {
features::kAudioServiceAudioStreams,
features::kAudioServiceOutOfProcess};
switch (GetParam()) {
case AudioServiceFeatures::kDisabled:
// Force audio service out of process to disabled.
audio_service_features_.InitWithFeatures({},
audio_service_oop_features);
break;
case AudioServiceFeatures::kOutOfProcess:
// Force audio service out of process to enabled.
audio_service_features_.InitWithFeatures(
audio_service_oop_features,
#if defined(OS_WIN)
// Force audio service sandboxing (available only on Windows) to
// disabled.
{service_manager::features::kAudioServiceSandbox});
#else
{});
#endif
break;
#if defined(OS_WIN)
case AudioServiceFeatures::kSandboxed:
// Force audio service out of process and sandboxing to enabled.
audio_service_oop_features.push_back(
service_manager::features::kAudioServiceSandbox);
audio_service_features_.InitWithFeatures(audio_service_oop_features,
{});
break;
#endif
#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
case AudioServiceFeatures::kSandboxedWithAudioServiceAPM:
audio_service_oop_features.push_back(
service_manager::features::kAudioServiceSandbox);
audio_service_oop_features.push_back(
features::kWebRtcApmInAudioService);
#endif
if (GetParam()) {
// Force audio service out of process to enabled.
audio_service_features_.InitWithFeatures(audio_service_oop_features, {});
} else {
// Force audio service out of process to disabled.
audio_service_features_.InitWithFeatures({}, audio_service_oop_features);
}
}
~WebRtcAudioBrowserTest() override {}
......@@ -178,30 +130,14 @@ IN_PROC_BROWSER_TEST_P(WebRtcAudioBrowserTest,
// We run these tests with the audio service both in and out of the the browser
// process to have waterfall coverage while the feature rolls out. It should be
// removed after launch.
#if defined(OS_LINUX) || defined(OS_MACOSX)
#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
// Supported platforms.
INSTANTIATE_TEST_CASE_P(
,
WebRtcAudioBrowserTest,
::testing::Values(AudioServiceFeatures::kDisabled,
AudioServiceFeatures::kOutOfProcess,
AudioServiceFeatures::kSandboxedWithAudioServiceAPM));
#elif defined(OS_WIN)
// On Windows, also run in sandboxed mode.
INSTANTIATE_TEST_CASE_P(
,
WebRtcAudioBrowserTest,
::testing::Values(AudioServiceFeatures::kDisabled,
AudioServiceFeatures::kOutOfProcess,
AudioServiceFeatures::kSandboxed,
AudioServiceFeatures::kSandboxedWithAudioServiceAPM));
INSTANTIATE_TEST_CASE_P(, WebRtcAudioBrowserTest, ::testing::Bool());
#elif defined(OS_ANDROID) && defined(ADDRESS_SANITIZER)
// Renderer crashes under Android ASAN: https://crbug.com/408496.
#else
// Platforms where the out of process audio service isn't supported
INSTANTIATE_TEST_CASE_P(,
WebRtcAudioBrowserTest,
::testing::Values(AudioServiceFeatures::kDisabled));
INSTANTIATE_TEST_CASE_P(, WebRtcAudioBrowserTest, ::testing::Values(false));
#endif
} // namespace content
......@@ -34,7 +34,6 @@
#if defined(OS_WIN)
#include "base/win/windows_version.h"
#include "services/service_manager/sandbox/features.h"
#endif
namespace {
......@@ -58,18 +57,6 @@ static const char kRenderDuplicatedMediastreamAndStop[] =
// Results returned by JS.
static const char kOK[] = "OK";
// Temporary enum, used for running the tests with different combination of
// flags while audio service is under experiment.
// TODO(https://crbug.com/850878) Remove after enabling sandboxing on all
// platforms.
enum class AudioServiceFeatures {
kDisabled,
kOutOfProcess,
#if defined(OS_WIN)
kSandboxed,
#endif
};
std::string GenerateGetUserMediaWithMandatorySourceID(
const std::string& function_name,
const std::string& audio_source_id,
......@@ -115,9 +102,8 @@ bool VerifyDisableLocalEcho(bool expect_value,
namespace content {
class WebRtcGetUserMediaBrowserTest
: public WebRtcContentBrowserTestBase,
public testing::WithParamInterface<AudioServiceFeatures> {
class WebRtcGetUserMediaBrowserTest : public WebRtcContentBrowserTestBase,
public testing::WithParamInterface<bool> {
public:
WebRtcGetUserMediaBrowserTest() {
// Automatically grant device permission.
......@@ -125,33 +111,12 @@ class WebRtcGetUserMediaBrowserTest
std::vector<base::Feature> audio_service_oop_features = {
features::kAudioServiceAudioStreams,
features::kAudioServiceOutOfProcess};
switch (GetParam()) {
case AudioServiceFeatures::kDisabled:
// Force audio service out of process to disabled.
audio_service_features_.InitWithFeatures({},
audio_service_oop_features);
break;
case AudioServiceFeatures::kOutOfProcess:
// Force audio service out of process to enabled.
audio_service_features_.InitWithFeatures(
audio_service_oop_features,
#if defined(OS_WIN)
// Force audio service sandboxing (available only on Windows) to
// disabled.
{service_manager::features::kAudioServiceSandbox});
#else
{});
#endif
break;
#if defined(OS_WIN)
case AudioServiceFeatures::kSandboxed:
// Force audio service out of process and sandboxing to enabled.
audio_service_oop_features.push_back(
service_manager::features::kAudioServiceSandbox);
audio_service_features_.InitWithFeatures(audio_service_oop_features,
{});
break;
#endif
if (GetParam()) {
// Force audio service out of process to enabled.
audio_service_features_.InitWithFeatures(audio_service_oop_features, {});
} else {
// Force audio service out of process to disabled.
audio_service_features_.InitWithFeatures({}, audio_service_oop_features);
}
}
~WebRtcGetUserMediaBrowserTest() override {}
......@@ -825,7 +790,7 @@ IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest,
GetAudioStreamAndCheckMutingInitiallyUnmuted) {
// Muting tests do not work with the out-of-process audio service.
// https://crbug.com/843490.
if (GetParam() != AudioServiceFeatures::kDisabled)
if (GetParam())
return;
ASSERT_TRUE(embedded_test_server()->Start());
......@@ -854,7 +819,7 @@ IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest,
GetAudioStreamAndCheckMutingInitiallyMuted) {
// Muting tests do not work with the out-of-process audio service.
// https://crbug.com/843490.
if (GetParam() != AudioServiceFeatures::kDisabled)
if (GetParam())
return;
ASSERT_TRUE(embedded_test_server()->Start());
......@@ -884,7 +849,7 @@ IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest,
RecoverFromCrashInAudioService) {
// This test only makes sense with the audio service running out of process,
// with or without sandbox.
if (GetParam() == AudioServiceFeatures::kDisabled)
if (!GetParam())
return;
ASSERT_TRUE(embedded_test_server()->Start());
......@@ -907,24 +872,15 @@ IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest,
// We run these tests with the audio service both in and out of the the browser
// process to have waterfall coverage while the feature rolls out. It should be
// removed after launch.
#if (defined(OS_LINUX) && !defined(CHROME_OS)) || defined(OS_MACOSX)
#if (defined(OS_LINUX) && !defined(CHROME_OS)) || defined(OS_MACOSX) || \
defined(OS_WIN)
// Supported platforms.
INSTANTIATE_TEST_CASE_P(,
WebRtcGetUserMediaBrowserTest,
::testing::Values(AudioServiceFeatures::kDisabled,
AudioServiceFeatures::kOutOfProcess));
#elif defined(OS_WIN)
// On Windows, also run in sandboxed mode.
INSTANTIATE_TEST_CASE_P(,
WebRtcGetUserMediaBrowserTest,
::testing::Values(AudioServiceFeatures::kDisabled,
AudioServiceFeatures::kOutOfProcess,
AudioServiceFeatures::kSandboxed));
INSTANTIATE_TEST_CASE_P(, WebRtcGetUserMediaBrowserTest, ::testing::Bool());
#else
// Platforms where the out of process audio service is not supported
INSTANTIATE_TEST_CASE_P(,
WebRtcGetUserMediaBrowserTest,
::testing::Values(AudioServiceFeatures::kDisabled));
::testing::Values(false));
#endif
} // namespace content
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment